/// <summary> /// Creates a property for a "::Ferda::Modules::StringT". There can be not /// only string, but also types of ComboBoxes and this method decides, which /// FerdaPropertySpec will be created /// </summary> /// <param name="pinfo">Information about the property</param> /// <param name="box">Box where it finds the other property</param> /// <param name="bag">Bag where to put the FerdaPropertySpec</param> protected void CreateStringProperty(PropertyInfo pinfo, IBoxModule box, PropertyTable bag) { FerdaPropertySpec ps; SelectString[] array; //determining the type of the property array = box.GetPropertyOptions(pinfo.name); if (array.Length == 0) //it is a normal string property { SocketInfo si = box.MadeInCreator.GetSocket(pinfo.name); ps = new FerdaPropertySpec(si.label, typeof(string), false); ps.Category = pinfo.categoryName; ps.Description = si.hint; if (box.IsPropertyReadOnly(pinfo.name) || box.GetPropertySocking(pinfo.name)) { ps.Attributes = new Attribute[] { ReadOnlyAttribute.Yes }; } bag.Properties.Add(ps); //adding the asynch stuff AddAsyncTemporary(pinfo.name, "System.String", !IsOneBoxSelected); } else //a combo-box should be used { //if there are more boxes selected, the property should not be added if (!IsOneBoxSelected) { return; } if (box.ArePropertyOptionsObligatory(pinfo.name)) //this means user cannot edit values { SocketInfo si = box.MadeInCreator.GetSocket(pinfo.name); ps = new FerdaPropertySpec(si.label, typeof(StringSequence), false); ps.Category = pinfo.categoryName; ps.Description = si.hint; //atributes if (box.IsPropertyReadOnly(pinfo.name) || box.GetPropertySocking(pinfo.name)) { ps.Attributes = new Attribute[] { ReadOnlyAttribute.Yes, new EditorAttribute(typeof(StringComboEditor), typeof(System.Drawing.Design.UITypeEditor)), new TypeConverterAttribute(typeof(StringSequenceConverter)) }; } else { ps.Attributes = new Attribute[] { new EditorAttribute(typeof(StringComboEditor), typeof(System.Drawing.Design.UITypeEditor)), new TypeConverterAttribute(typeof(StringSequenceConverter)) }; } //adding to the bag bag.Properties.Add(ps); } else //user can add his own option to the string selection { SocketInfo si = box.MadeInCreator.GetSocket(pinfo.name); ps = new FerdaPropertySpec(si.label, typeof(StringSequence), false); ps.Description = si.hint; ps.Category = pinfo.categoryName; //atributes if (box.IsPropertyReadOnly(pinfo.name) || box.GetPropertySocking(pinfo.name)) { ps.Attributes = new Attribute[] { ReadOnlyAttribute.Yes, new EditorAttribute(typeof(StringComboAddingEditor), typeof(System.Drawing.Design.UITypeEditor)), new TypeConverterAttribute(typeof(StringSequenceConverter)) }; } else { ps.Attributes = new Attribute[] { new EditorAttribute(typeof(StringComboAddingEditor), typeof(System.Drawing.Design.UITypeEditor)), new TypeConverterAttribute(typeof(StringSequenceConverter)) }; } //adding to the bag bag.Properties.Add(ps); } //adding the asynch stuff if (IsOneBoxSelected) { AddAsyncTemporary(pinfo.name, "Ferda.FrontEnd.Properties.StringSequence", false); } } }