Exemplo n.º 1
0
 private void Rebuild()
 {
     this.RemoveEventHandlers();
     if (this.PropertyValue != null)
     {
         this.childrenView = CollectionViewSource.GetDefaultView(this.PropertyValue.get_Collection());
         this.childrenView.CurrentChanged    += new EventHandler(this.OnChildrenViewCurrentChanged);
         this.childrenView.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnCollectionChanged);
         this.childrenView.MoveCurrentTo(null);
         this.UpdateSelectedItem();
         using (IEnumerator <KeyValuePair <Type, IList <NewItemFactory> > > enumerator1 = ((IEnumerable <KeyValuePair <Type, IList <NewItemFactory> > >)ExtensibilityMetadataHelper.GetNewItemFactoriesFromAttributes(this.model.GetNewItemTypesAttributes(), this.model.MessageLoggingService)).GetEnumerator())
         {
             while (((IEnumerator)enumerator1).MoveNext())
             {
                 KeyValuePair <Type, IList <NewItemFactory> > current1 = enumerator1.Current;
                 using (IEnumerator <NewItemFactory> enumerator2 = ((IEnumerable <NewItemFactory>)current1.Value).GetEnumerator())
                 {
                     while (((IEnumerator)enumerator2).MoveNext())
                     {
                         NewItemFactory current2 = enumerator2.Current;
                         this.quickTypeCollection.Add(new NewItemFactoryTypeModel(current1.Key, current2, this.model.MessageLoggingService));
                     }
                 }
             }
         }
         this.quickTypes.CurrentChanged += new EventHandler(this.OnQuickTypesCurrentChanged);
     }
     else
     {
         this.childrenView = (ICollectionView)null;
     }
     this.OnPropertyChanged("ChildrenView");
 }
Exemplo n.º 2
0
 private void Rebuild()
 {
     this.RemoveEventHandlers();
     if (this.PropertyValue != null)
     {
         this.childrenView = CollectionViewSource.GetDefaultView((object)this.PropertyValue.Collection);
         this.childrenView.CurrentChanged    += new EventHandler(this.OnChildrenViewCurrentChanged);
         this.childrenView.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnCollectionChanged);
         this.childrenView.MoveCurrentTo((object)null);
         this.UpdateSelectedItem();
         foreach (KeyValuePair <Type, IList <NewItemFactory> > keyValuePair in (IEnumerable <KeyValuePair <Type, IList <NewItemFactory> > >)ExtensibilityMetadataHelper.GetNewItemFactoriesFromAttributes(this.model.GetNewItemTypesAttributes(), this.model.MessageLoggingService))
         {
             foreach (NewItemFactory factory in (IEnumerable <NewItemFactory>)keyValuePair.Value)
             {
                 this.quickTypeCollection.Add(new NewItemFactoryTypeModel(keyValuePair.Key, factory, this.model.MessageLoggingService));
             }
         }
         this.quickTypes.CurrentChanged += new EventHandler(this.OnQuickTypesCurrentChanged);
     }
     else
     {
         this.childrenView = (ICollectionView)null;
     }
     this.OnPropertyChanged("ChildrenView");
 }