Ejemplo n.º 1
0
 public void DestroyExtendedProperties()
 {
     if (this.extendedProperties != null)
     {
         this.extendedProperties.OnDestroy();
         this.extendedProperties = null;
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
                }
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public void Editor_ReplaceExtendedProperties(EntityExtendedProperties extendedProperties)
 {
     this.extendedProperties = extendedProperties;
 }