Example #1
0
 private void OnOptionsModelPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (!(e.PropertyName == ProjectSystemOptionsModel.UseVisualStudioEventHandlerSupportProperty))
     {
         return;
     }
     if (this.model != null)
     {
         this.model.Dispose();
         this.model = (EventsModel.Model)null;
     }
     this.UpdateModel();
 }
Example #2
0
        private void UpdateModel()
        {
            SceneElement selection = this.GetSelection();

            if (selection != null && !this.HiddenMode)
            {
                if (this.model != null && selection.DocumentNode == this.model.Node)
                {
                    return;
                }
            }
            else if (this.model == null)
            {
                return;
            }
            if (this.model != null)
            {
                this.model.Dispose();
                this.model = (EventsModel.Model)null;
            }
            if (selection != null && !this.HiddenMode)
            {
                SceneViewModel        viewModel = selection.ViewModel;
                List <SceneNode>      list      = new List <SceneNode>();
                DocumentCompositeNode node      = selection.DocumentNode as DocumentCompositeNode;
                if (node != null)
                {
                    list.Add((SceneNode)selection);
                }
                this.model = new EventsModel.Model(this.designerContext, viewModel.Document, node);
                this.eventSubscription.SetBasisNodes(viewModel, (IEnumerable <SceneNode>)list);
            }
            this.OnPropertyChanged("IsEnabled");
            this.OnPropertyChanged("Message");
            this.OnPropertyChanged("EventHandlers");
        }