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
Hi,
I really don't know how to use scripts correctly but I try ...
I want to check if the session is RACE or not to mask a the label wich inform the number of lap in race.
This label is in Widget with dataset SESSION STATE.
I try to adapt a script I see here but it must be use with other dataset ...

using System; 
using ATVO.ThemesSDK;
using ATVO.ThemesSDK.Data.Entity;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Controls;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Enums;
using ATVO.ThemesSDK.Data.Results;
namespace Scripts
{
public class Script : IScript
{
public object Execute(ThemeContentItem item, object value,string parameter, ISimulation sim)
{
// Bind to "entitysessionresult_obj" to get the IEntitySessionResult as the value

// Cast to IEntitySessionResult type
IEntitySessionResult sessionResult = (IEntitySessionResult) sessionResult;


var type = result.Session.Type;

if (type == SessionType.Race)

return "Lap";
else
return "";
}

}

}


I use data converter, but I can't set entitysessionresult_obj in this data set.