/// <summary> /// Change the name of this EditInterface. /// </summary> /// <param name="name"></param> public void setName(String name) { if (this.name != name) { this.name = name; if (OnNameChanged != null) { OnNameChanged.Invoke(this); } } }
public void Init() { if (!_isInitted) { _provider = GetComponent <IProvider <T> >(); _pickHandler = GetComponent <IPickHandler <T> >(); RegisterDynamicProvider(); OnNameChanged?.Invoke(this); _isInitted = true; if (_provider != null) { SetPickables(_provider.Get()); } } }
public void ChangeName(string name) { var conf = configProvider.GetConfig(); if (conf is null) { throw new ConfigException(Resources.ConfigNotFound); } if (conf.Info is null) { throw new ConfigException(Resources.ConfigInfoIsNull); } var shared = configProvider.GetSharedConfig(); var tmp = conf.Info.Name; conf.Info.Name = name; if (shared != null && shared.Config != null && shared.Config.Info != null) { shared.Config.Info.Name = name; } try { OnConfigNameChanged?.Invoke(this, conf, name); } catch { conf.Info.Name = tmp; if (shared != null && shared.Config != null && shared.Config.Info != null) { shared.Config.Info.Name = tmp; } throw; } configProvider.Commit(); OnNameChanged?.Invoke(this, name); }
private void RaiseOnNameChangedEvent() { OnNameChanged?.Invoke(this, EventArgs.Empty); }
public virtual void SetPickables(IEnumerable <T> pickables) { _pickables = pickables.ToList(); UpdateButtons(); OnNameChanged?.Invoke(this); }
public virtual void RemovePickables(IEnumerable <T> pickables) { _pickables.RemoveAll(x => pickables.Contains(x)); UpdateButtons(); OnNameChanged?.Invoke(this); }
public virtual void AddPickables(IEnumerable <T> pickables) { _pickables.AddRange(pickables); UpdateButtons(); OnNameChanged?.Invoke(this); }