public void Merge(ConditionActionBase clone) { if (Name != clone.Name) { Name = clone.Name; } if (DataType != clone.DataType) { DataType = clone.DataType; } if (DefaultText != clone.DefaultText) { DefaultText = clone.DefaultText; } DefaultBool = clone.DefaultBool; Background = clone.Background; TooltipText = clone.TooltipText; //EnumValues.Clear(); while (EnumValues.Count != 0) { EnumValues.RemoveAt(0); } foreach (EnumValue value in clone.EnumValues) { EnumValues.Add(value); } }
public void AddLocalEnumOption(string new_option) { EnumValues.Add(new_option); RaisePropertyChanged("EnumValues"); RaisePropertyChanged("Options"); Dirty = true; }
public EnumValuesBuilder Value( string value, string description, IEnumerable <DirectiveInstance> directives, string deprecationReason) { _values.Add(value, description, directives, deprecationReason); return(this); }
public void SetNavigationValue(string val) { if (IsEnum) { EnumValues.Add(val); } else if (IsDateTime) { Date1 = DateTime.FromOADate(double.Parse(val, CultureInfo.InvariantCulture)); } else { Value1 = val; } }
public void LoadFromXml(XmlElement el, XmlNamespaceManager nsmgr) { string pr = nsmgr.LookupPrefix(XmlSchemaUtil.WORKFLOW_NAMESPACE); if (pr != null && pr.Length > 0) { pr += ":"; } Name = el.GetAttribute("name"); foreach (XmlElement v in el.SelectNodes(pr + "value", nsmgr)) { string sv = v.InnerText; //object ev = Convert.ChangeType(sv, BaseType.ValueType); EnumValues.Add(sv); } }
private void ExtractEnumValues(string text) { text = text.Replace("{", "").Trim().Replace("}", "").Trim(); string[] enumVals = text.Split(','); int eVal = 0; for (int i = 0; i < enumVals.Length; i++) { if (enumVals[i].Contains("=")) { int eqIndex = enumVals[i].IndexOf('='); string numStr = enumVals[i].Substring(eqIndex + 1).Trim(); eVal = int.Parse(numStr); enumVals[i] = enumVals[i].Substring(0, eqIndex).Trim() + " = " + eVal; eVal++; } else { enumVals[i] = enumVals[i] + " = " + eVal; eVal++; } EnumValues.Add(enumVals[i]); } }
public virtual void ReadFrom(XElement xE) { FieldName = null; DisplayFieldName = null; XmlAttributeName = null; FieldType = null; FieldBehavior = null; EnumValues = null; CanSelect = null; CanFilter = null; IsEnumType = null; IsBeta = null; IsZeroRowCompatible = null; EnumValuePairs = null; ExclusiveFields = null; foreach (var xItem in xE.Elements()) { var localName = xItem.Name.LocalName; if (localName == "fieldName") { FieldName = xItem.Value; } else if (localName == "displayFieldName") { DisplayFieldName = xItem.Value; } else if (localName == "xmlAttributeName") { XmlAttributeName = xItem.Value; } else if (localName == "fieldType") { FieldType = xItem.Value; } else if (localName == "fieldBehavior") { FieldBehavior = xItem.Value; } else if (localName == "enumValues") { if (EnumValues == null) { EnumValues = new List <string>(); } EnumValues.Add(xItem.Value); } else if (localName == "canSelect") { CanSelect = bool.Parse(xItem.Value); } else if (localName == "canFilter") { CanFilter = bool.Parse(xItem.Value); } else if (localName == "isEnumType") { IsEnumType = bool.Parse(xItem.Value); } else if (localName == "isBeta") { IsBeta = bool.Parse(xItem.Value); } else if (localName == "isZeroRowCompatible") { IsZeroRowCompatible = bool.Parse(xItem.Value); } else if (localName == "enumValuePairs") { if (EnumValuePairs == null) { EnumValuePairs = new List <EnumValuePair>(); } var enumValuePairsItem = new EnumValuePair(); enumValuePairsItem.ReadFrom(xItem); EnumValuePairs.Add(enumValuePairsItem); } else if (localName == "exclusiveFields") { if (ExclusiveFields == null) { ExclusiveFields = new List <string>(); } ExclusiveFields.Add(xItem.Value); } } }
public void AddEnumValue(string val) { EnumValues.Add(val); }