Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Emmanuel S
on
At Nick, finally I decide to use a combinaison beetween scripts and CustomsClasses.
I use a Ticker and decide to override color class by iracing or CustomClasses, but if only one class I want to have other color than White.
I done this and it is ok ;)
Binding is classcolor
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using System.Windows.Media;
using ATVO.ThemesSDK.Data.Entity;
using ATVO.ThemesSDK.Data.Results;


namespace Scripts
{
public class SC_ClassColor : IScript
{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
if (value == null)
{
    // do something appropriate, in this case probably just return nothing
    return null;
}
var Classcolor = value.ToString();
var numClasses = sim.Session.ClassManager.Classes.Count;
var hex = "#17a5ff";

if (numClasses == 1)
return (Color) ColorConverter.ConvertFromString(hex);
else
return (Color) ColorConverter.ConvertFromString(Classcolor);
}
}
}