Exemple #1
0
 public void DestroyExtendedProperties()
 {
     if (this.extendedProperties != null)
     {
         this.extendedProperties.OnDestroy();
         this.extendedProperties = null;
     }
 }
Exemple #2
0
        public EntityExtendedProperties CreateExtendedProperties(Type extendedPropertiesClass)
        {
            this.DestroyExtendedProperties();
            ConstructorInfo constructor = extendedPropertiesClass.GetConstructor(new Type[0]);

            this.extendedProperties    = (EntityExtendedProperties)constructor.Invoke(null);
            this.extendedProperties.zT = this;
            return(this.extendedProperties);
        }
Exemple #3
0
        protected internal virtual void OnSave(TextBlock block)
        {
            string text = this.Owner.Type.Name;

            if (this.Owner.Name != "")
            {
                text += string.Format(" ({0})", this.Owner.Name);
            }
            text = string.Format("Entity: \"{0}\"; ExtendedProperties", text);
            foreach (EntityExtendedProperties.AT current in EntityExtendedProperties.A(base.GetType()))
            {
                if (                /*EntitySystemWorld.Instance.isEntityExtendedPropertiesSerializable(current.supportedSerializationTypes) && */
                    !EntityHelper.SaveFieldValue(true, this, current.field, block, null, text))
                {
                    break;
                }
            }
        }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            Entity ownerEntity = null;
            EntityCustomTypeDescriptor entityCustomTypeDescriptor = context.Instance as EntityCustomTypeDescriptor;

            if (entityCustomTypeDescriptor != null)
            {
                ownerEntity = entityCustomTypeDescriptor.Entity;
            }
            EntityExtendedProperties entityExtendedProperties = context.Instance as EntityExtendedProperties;

            if (entityExtendedProperties != null)
            {
                ownerEntity = entityExtendedProperties.Owner;
            }
            Type   propertyType = context.PropertyDescriptor.PropertyType;
            Entity result       = (Entity)value;

            if (DesignerInterface.Instance.EntityUITypeEditorEditValue(ownerEntity, propertyType, ref result))
            {
                return(result);
            }
            return(value);
        }
Exemple #5
0
 public void Editor_ReplaceExtendedProperties(EntityExtendedProperties extendedProperties)
 {
     this.extendedProperties = extendedProperties;
 }