コード例 #1
0
 private void SetupPropertyAfterInitialize(object obj, string name, Type propertyType, object value, string category, string description, string editor, string typeConverter)
 {
     if (HasTypeConverter(obj, propertyType, typeConverter))
     {
         PropertyDetail spec = Properties[Properties.IndexOf(name)];
         if (propertyType == typeof(Interval))
         {
             spec.DefaultValue = value;
         }
         else
         {
             HandleReadOnly(value, spec);
         }
         values[name] = value;
     }
     else
     {
         if (value != null && value != obj)
         {
             PropertyDetail spec  = Properties[Properties.IndexOf(name)];
             PropertyTable  table = (PropertyTable)values[name];
             table.UpdateAfterInitialize();
         }
     }
 }
コード例 #2
0
 private void HandleReadOnly(object value, PropertyDetail detail)
 {
     if (value == null || !value.Equals(detail.DefaultValue))
     {
         detail.IsReadOnly  = true;
         detail.Description = "READ ONLY: Properties that you set in OnInitialize() are read only to the GUI because project settings apply before and get overwritten by OnInitialize().";
     }
 }
コード例 #3
0
		PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty()
		{
			PropertyDetail propertySpec = null;
			if(defaultProperty != null)
			{
				int index = properties.IndexOf(defaultProperty);
				propertySpec = properties[index];
			}

			if(propertySpec != null)
				return new PropertyDetailDescriptor(propertySpec, this, propertySpec.Name, null);
			else
				return null;
		}
コード例 #4
0
 private void SetPropertyFromProjectFile(object obj, string name, Type propertyType, object value, string category, string description, string editor, string typeConverter)
 {
     if (HasTypeConverter(obj, propertyType, typeConverter))
     {
         PropertyDetail spec = Properties[Properties.IndexOf(name)];
         values[name] = value;
     }
     else
     {
         if (value != null && value != obj)
         {
             PropertyDetail spec  = Properties[Properties.IndexOf(name)];
             PropertyTable  table = (PropertyTable)values[name];
             table.UpdateAfterProjectFile();
         }
     }
 }
コード例 #5
0
 private void SetupProperty(object obj, string name, Type propertyType, object value, string category, string description, string editor, string typeConverter)
 {
     if (propertyType.FullName.Equals("TickZoom.Api.Elapsed"))
     {
         editor        = "ElapsedPropertyEditor";
         typeConverter = typeof(ElapsedTypeConverter).AssemblyQualifiedName;
     }
     if (propertyType == typeof(TimeStamp))
     {
         editor        = "TimestampPropertyEditor";
         typeConverter = typeof(TimestampTypeConverter).AssemblyQualifiedName;
     }
     if (propertyType == typeof(Interval))
     {
         editor        = "IntervalPropertyEditor";
         typeConverter = typeof(IntervalTypeConverter).AssemblyQualifiedName;
     }
     if (propertyType == typeof(Interval))
     {
         editor        = "IntervalPropertyEditor";
         typeConverter = typeof(IntervalTypeConverter).AssemblyQualifiedName;
     }
     if (HasTypeConverter(obj, propertyType, typeConverter))
     {
         PropertyDetail detail = new PropertyDetail(name, propertyType, category, description, value, editor, typeConverter);
         this.Properties.Add(detail);
         this.DefaultProperty = name;
         values[name]         = value;
     }
     else
     {
         if (value != null && !value.Equals(obj))
         {
             PropertyTable  table  = new PropertyTable(value);
             PropertyDetail detail = new PropertyDetail(name, table.GetType(), category, description);
             this.Properties.Add(detail);
             values[name] = table;
         }
     }
 }
コード例 #6
0
		public abstract void SetValue(PropertyDetail item, object value);
コード例 #7
0
		public abstract object GetValue(PropertyDetail item);
コード例 #8
0
 public PropertyDetailDescriptor(PropertyDetail item, PropertyStore store, string name, Attribute[] attrs) :
     base(name, attrs)
 {
     this.store = store;
     this.info  = item;
 }
コード例 #9
0
 public PropertyDetailEventArgs(PropertyDetail property, object val)
 {
     this.property = property;
     this.val      = val;
 }
コード例 #10
0
 public override void SetValue(PropertyDetail item, object value)
 {
     values[item.Name] = value;
 }
コード例 #11
0
 public override object GetValue(PropertyDetail item)
 {
     return(values[item.Name]);
 }