/// <summary> /// Code ajouté lors de la création d'une action /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ListVariables_ItemToCreate(object sender, EventArgs e) { VO_Variable newItem = _Service.CreateVariable(); newItem.Title = GlobalConstants.VARIABLE_NEW_ITEM; ListVariables.AddItem(newItem.Id, newItem.Title); LoadVariable(newItem.Id); }
public LostTime(string Name, ListVariables ListVariables, string LostTimes, int tempValue, int timeMax, DateTime dtBegin, DateTime dtEnd, isLost isLost, bool blStart) { this.Name = Name; this.LostTimes = LostTimes; this.timeMax = timeMax; this.dtBegin = dtBegin; this.dtEnd = dtEnd; this.isLost = isLost; this.tempValue = tempValue; this.ListVariables = ListVariables; this.blStart = blStart; }
private void OnDestroy() { ListVariables list = this.listVariables.GetListVariables(gameObject); if (list != null) { return; } VariablesManager.events.StopListenListAdd(this.OnListCallback, this.cacheList.gameObject); VariablesManager.events.StopListenListRmv(this.OnListCallback, this.cacheList.gameObject); VariablesManager.events.StopListenListChg(this.OnListCallback, this.cacheList.gameObject); }
public ToolGr(string Name, string sShow, TypeGr TypeGr, ListVariables ListVariables, Brush brFont, Brush BackColor, double maxTime, Font font, bool isChar, bool isVal, bool isConst) { this.Name = Name; this.TypeGr = TypeGr; this.ListVariables = ListVariables; this.BackColor = BackColor; this.brFont = brFont; this.sShow = sShow; this.isChar = isChar; this.isVal = isVal; this.font = font; this.isConst = isConst; this.maxTime = maxTime; }
public ToolGr(string Name, string sShow, TypeGr TypeGr, ListVariables ListVariables, Brush brFont, Brush BackColor, int sizeFont, int defaut, Font font, bool isChar, bool isVal, bool isConst) { this.Name = Name; this.TypeGr = TypeGr; this.ListVariables = ListVariables; this.BackColor = BackColor; this.brFont = brFont; this.sShow = sShow; this.isChar = isChar; this.isVal = isVal; this.font = font; this.sizeFont = sizeFont; this.isConst = isConst; this.defaut = defaut; }
/// <summary> /// Au chargement du controle /// </summary> /// <param name="e"></param> protected override void OnLoad(EventArgs e) { base.OnLoad(e); CurrentVariable = null; ProvisionList(); if (ListVariables.DataSource.Count > 0) { Guid firstAction = ListVariables.DataSource[0].Id; ListVariables.SelectItem(firstAction); LoadVariable(firstAction); } else { ListVariables_ListIsEmpty(this, new EventArgs()); } }
private void Start() { this.cacheObserver = this.observer.GetComponent <Perception>(gameObject); this.cacheList = this.listVariables.GetListVariables(gameObject); if (this.cacheList == null || this.cacheObserver == null) { return; } VariablesManager.events.StartListenListAdd(this.OnListCallback, this.cacheList.gameObject); VariablesManager.events.StartListenListRmv(this.OnListCallback, this.cacheList.gameObject); VariablesManager.events.StartListenListChg(this.OnListCallback, this.cacheList.gameObject); for (int i = 0; i < this.cacheList.variables.Count; ++i) { GameObject value = this.cacheList.variables[i].Get <GameObject>(); this.OnListCallback(i, null, value); } }
public override bool InstantExecute(GameObject target, IAction[] actions, int index) { Transform originTransform = this.origin.GetTransform(target); if (originTransform == null) { return(true); } Collider[] colliders = this.GatherColliders(target); List <GameObject> array = new List <GameObject>(); string compareTag = this.withTag.GetValue(target); for (int i = 0; i < colliders.Length; ++i) { if (colliders[i].gameObject.CompareTag(compareTag)) { array.Add(colliders[i].gameObject); } } array.Sort((x, y) => { float distanceX = Vector3.Distance(originTransform.position, x.transform.position); float distanceY = Vector3.Distance(originTransform.position, y.transform.position); return(distanceX.CompareTo(distanceY)); }); ListVariables list = this.listVariables.GetListVariables(target); VariablesManager.ListClear(list); foreach (GameObject element in array) { VariablesManager.ListPush(list, ListVariables.Position.Last, element); } return(true); }
/// <summary> /// Charge la liste des boutons /// </summary> private void ProvisionList() { ListVariables.DataSource = _Service.ProvisionList(); ListVariables.LoadList(); }
/// <summary> /// Le titre a changé /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtName_TextChanged(object sender, EventArgs e) { ListVariables.ChangeItemName(CurrentVariable.Id, txtName.Text); CurrentVariable.Title = txtName.Text; }