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
"""Edit: I doing some tests, cause I think the problems comes from an error of manipulation of me. I change somes informations dirct in the XML like add actions in StoryBoard cause it is quick, but I think I do some little errors that don't stop system.
So I do my theme again without touch anything in XML an I will say if it is OK."""


ClassColor, I bind 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;
}


//IEntitySessionResult result = (IEntitySessionResult) value;

//var Classcolor = result.Entity.Car.Class.Color;
var Classcolor = value.ToString();
var numClasses = sim.Session.ClassManager.Classes.Count;
var hex = "#ffe617";

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

else

return (Color) ColorConverter.ConvertFromString(Classcolor);
}
}
}