public override void CopyLibraryValues(ILibraryElement source) { if (!(source is IOutputEditor outputEditor)) { throw new ArgumentException("Copied source is not " + typeof(IOutputEditor)); } this.OutputSignals.Clear(); this.OutputSignals.AddRange(outputEditor.OutputSignals); }
public SystemJournalViewModel(ILibraryElement model) { this.OutputSignals = new ObservableCollection <EditableListItem>(); this.OutputSignals.CollectionChanged += this.OutputSignalsOnCollectionChanged; this.AddOutputSignalCommand = new RelayCommand(this.OnAddOutputSignal); this.RemoveOutputSignalCommand = new RelayCommand(this.OnRemoveOutputSignal, this.CanRemoveOutputSignal); SetModel(model); }
public InputEditorViewModel(ILibraryElement model) { this.Bases = new ObservableCollection <EditableListItem>(); this.InputSignals = new ObservableCollection <BindableKeyValuePair <int, string> >(); this._allInputSignals = new List <Dictionary <int, string> >(); this.AddBaseCommand = new RelayCommand(this.AddBase); this.RemoveBaseCommand = new RelayCommand(this.RemoveSelectedBase, this.CanRemoveBase); this.AddSignalCommand = new RelayCommand(this.AddInputSignal, this.CanAddInputSignal); this.RemoveSignalCommand = new RelayCommand(this.RemoveInputSignal, this.CanRemoveInputSignal); SetModel(model); }
/// <summary> /// Sync the info from the element and show the element info window when the mouse enters an element ui button /// </summary> /// <param name="libraryElement"></param> private void HandleLibraryElementEnterEvent(ILibraryElement libraryElement) { var element = libraryElement.Element; nameText.text = element.name; idText.text = string.Format("{0}", element.id.ToHexString()); descriptionText.text = element.description; ClearTags(); GenerateTags(element.tags); StartCoroutine(SetThumbnailAsync(element)); TweenAppearance(1f, fadeInDuration); }
public override void CopyLibraryValues(ILibraryElement source) { if (!(source is IInputEditor inputSource)) { throw new ArgumentException("Copied source is not " + typeof(Input)); } this.Bases.Clear(); this.Bases.AddRange(inputSource.Bases); this.AllInputSignals = new List <Dictionary <int, string> >(inputSource.AllInputSignals); for (int i = 0; i < this.Bases.Count; i++) { var copiedDictionary = inputSource.AllInputSignals[i]; this.AllInputSignals[i] = new Dictionary <int, string>(copiedDictionary); } }
public virtual void CopyLibraryValues(ILibraryElement source) { }
public RsTriggerEditorViewModel(ILibraryElement model) { Model = model; }
public OrEditorViewModel(ILibraryElement model) { Model = model; }
public InversionEditorViewModel(ILibraryElement model) { Model = model; }
/// <summary> /// Close element info window when the mouse moves out of the element ui button /// </summary> /// <param name="libraryElement"></param> private void HandleLibraryElementExitEvent(ILibraryElement libraryElement) { TweenAppearance(0f, fadeOutDuration); StopAllCoroutines(); }