예제 #1
0
        private TriggerModel3 TriggerSubscription_Inserted(object sender, SceneNode basisNode, object basisContent, SceneNode newPathNode)
        {
            TriggerBaseNode trigger       = (TriggerBaseNode)newPathNode;
            TriggerModel3   triggerModel3 = TriggerModel3.ConstructModel(trigger, this);

            if (triggerModel3 != null)
            {
                ITriggerContainer currentContainer = this.CurrentContainer;
                if (currentContainer == null)
                {
                    return((TriggerModel3)null);
                }
                int triggerIndex = this.GetTriggerIndex(currentContainer, trigger);
                if (triggerIndex == -1)
                {
                    return((TriggerModel3)null);
                }
                if (this.ShouldDisplayNoneTrigger)
                {
                    ++triggerIndex;
                }
                this.triggerModels.Insert(triggerIndex, triggerModel3);
                if (trigger == this.TriggerToBeSelected)
                {
                    this.TriggerToBeSelected = (TriggerBaseNode)null;
                    this.SelectedItem        = triggerModel3;
                }
            }
            return(triggerModel3);
        }
예제 #2
0
        public void DeleteTrigger()
        {
            TriggerModel3 selectedItem = this.SelectedItem;

            if (selectedItem == null || selectedItem.DeleteCommand == null)
            {
                return;
            }
            selectedItem.DeleteCommand.Execute((object)null);
        }
예제 #3
0
        internal static TriggerModel3 ConstructModel(TriggerBaseNode trigger, TriggerModelManager triggerManager)
        {
            EventTriggerNode trigger1      = trigger as EventTriggerNode;
            BaseTriggerNode  trigger2      = trigger as BaseTriggerNode;
            TriggerModel3    triggerModel3 = (TriggerModel3)null;

            if (trigger1 != null)
            {
                triggerModel3 = (TriggerModel3) new EventTriggerModel(trigger1);
            }
            else if (trigger2 != null)
            {
                triggerModel3 = (TriggerModel3) new PropertyTriggerModel(trigger2, triggerManager);
            }
            if (triggerModel3 != null)
            {
                triggerModel3.Initialize();
            }
            return(triggerModel3);
        }
예제 #4
0
 private void TriggerSubscription_ContentChanged(object sender, SceneNode pathNode, TriggerModel3 content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     if (content == null)
     {
         return;
     }
     content.AddChange(damageMarker, damage, (IList <SubSubscription>) this.delayedUpdates);
 }
예제 #5
0
 private void TriggerSubscription_Removed(object sender, SceneNode basisNode, object basisContent, SceneNode oldPathNode, TriggerModel3 oldContent)
 {
     if (oldContent == null)
     {
         return;
     }
     this.triggerModels.Remove(oldContent);
     oldContent.Detach();
 }
예제 #6
0
        private void UpdateDeleteTrigger()
        {
            TriggerModel3 selectedItem = this.SelectedItem;

            this.deleteTriggerCommand.IsEnabled = selectedItem != null && selectedItem.DeleteCommand != null && selectedItem.DeleteCommand.CanExecute((object)null);
        }