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
Thanks a lot, I go step by step and certainly not by the good way :(

I only use the control if entity is Iteam to show my widget and it is OK.
But i need to assign the script to a label to get the binding to the script (in your exemple I first test to return driver if it is Iteam but tha value is not correct), so I decide to create a Widget only to get binding and I show an other Widget with TEAM NAME (no script for get team name).
But if it is possible to say directly into the script what I want to bind it will be better.

So now if I watch a Session with team, my widget with team name is automaticly visible, and I check with a no team session it stay OFF.

But I want to had this widget only when an other widget is visible (DRIVER INFO). I try to add a check for widget visibility, but again I have not the good "therms" to do it.

You can see my scripts that automaticaly show Team Name if session is team. But every time.
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Entity;
using System.Collections.Generic;
using ATVO.ThemesSDK.Data.Results;



namespace Scripts
{
public class Sc_Pilot_Team : IScript

{
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
if (value == null)
{
    return null;
}

IEntitySessionResult result = (IEntitySessionResult) value;

var entity = result.Entity;

var theme = item.Theme;
//find widget I want to show
var widget = theme.Widgets.Find("W_Pilote_Team");
//find widget to check VISIBLE for showing widget
var widget0 = theme.Widgets.Find("W_Pilote_Complet");

// Check if it's a team //I test if widget0.IsVisible == true but it is not OK
if (entity is ITeam)
{
widget.AnimateShow("0");

return null;
}
else
return null;
}
}}