Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
 public virtual void CopyLibraryValues(ILibraryElement source)
 {
 }
Пример #7
0
 public RsTriggerEditorViewModel(ILibraryElement model)
 {
     Model = model;
 }
Пример #8
0
 public OrEditorViewModel(ILibraryElement model)
 {
     Model = model;
 }
Пример #9
0
 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();
 }