예제 #1
0
 private void AddItem(NewItemFactoryTypeModel itemFactoryTypeModel)
 {
     if (itemFactoryTypeModel != null)
     {
         try
         {
             object instance = itemFactoryTypeModel.CreateInstance();
             if (instance == null)
             {
                 return;
             }
             this.SetPropertyAsObject(instance);
         }
         catch (Exception ex)
         {
             ((SceneNodeProperty)this.PropertyValue.get_ParentProperty()).SceneNodeObjectSet.DesignerContext.MessageLoggingService.WriteLine(string.Format((IFormatProvider)CultureInfo.CurrentCulture, ExceptionStringTable.ObjectEditorViewCollectionItemFactoryInstantiateFailed, new object[2]
             {
                 (object)((object)itemFactoryTypeModel.ItemFactory).GetType().Name,
                 (object)ExtensibilityMetadataHelper.GetExceptionMessage(ex)
             }));
         }
     }
     else
     {
         Type type = this.PromptForClrType();
         if (!(type != (Type)null))
         {
             return;
         }
         this.SetPropertyAsType(type);
     }
 }