protected override void Initialize() { TerritoryIdProperty = new EnumIntProperty(this, TerritoryId) { EnumType = "sales territory", }; PersonNameOperatorProperty = new OperatorProperty(this, PersonNameOperator) { Size = 25, EnumType = "operators", HasNullCheck = true, }; PersonNameProperty = new TextProperty(this, PersonName) { }; StoreNameOperatorProperty = new OperatorProperty(this, StoreNameOperator) { Size = 25, EnumType = "operators", HasNullCheck = true, }; StoreNameProperty = new TextProperty(this, StoreName) { }; AccountNumberOperatorProperty = new OperatorProperty(this, AccountNumberOperator) { Size = 25, EnumType = "operators", }; AccountNumberProperty = new TextProperty(this, AccountNumber) { Size = 10, }; }
protected override void Initialize() { CustomerNameProperty = new TextProperty(this, CustomerName); CustomerNameOperatorProperty = new OperatorProperty(this, CustomerNameOperator); CustomerNameOperatorProperty.Size = 10; CustomerNameOperatorProperty.EnumType = "operators"; CustomerNameOperatorProperty.HasNullCheck = true; CustomerStoreProperty = new TextProperty(this, CustomerStore); CustomerStoreOperatorProperty = new OperatorProperty(this, CustomerStoreOperator); CustomerStoreOperatorProperty.Size = 10; CustomerStoreOperatorProperty.EnumType = "operators"; CustomerStoreOperatorProperty.HasNullCheck = true; DueDateProperty = new DateProperty(this, DueDate); DueDate2Property = new DateProperty(this, DueDate2); DueDateOperatorProperty = new OperatorProperty(this, DueDateOperator); DueDateOperatorProperty.Size = 10; DueDateOperatorProperty.EnumType = "operators"; GlobalRegionProperty = new EnumProperty(this, GlobalRegion); GlobalRegionProperty.Size = 50; GlobalRegionProperty.EnumType = "sales territory group"; OrderDateProperty = new DateProperty(this, OrderDate); OrderDate2Property = new DateProperty(this, OrderDate2); OrderDateOperatorProperty = new OperatorProperty(this, OrderDateOperator); OrderDateOperatorProperty.Size = 10; OrderDateOperatorProperty.EnumType = "operators"; SalesOrderNumberProperty = new TextProperty(this, SalesOrderNumber); SalesOrderNumberProperty.Size = 25; SalesOrderNumberOperatorProperty = new OperatorProperty(this, SalesOrderNumberOperator); SalesOrderNumberOperatorProperty.Size = 10; SalesOrderNumberOperatorProperty.EnumType = "operators"; SalesPersonIdProperty = new EnumIntProperty(this, SalesPersonId); SalesPersonIdProperty.IsMultiValued = true; SalesPersonIdProperty.EnumType = "sales person"; SalesPersonIdOperatorProperty = new OperatorProperty(this, SalesPersonIdOperator); SalesPersonIdOperatorProperty.Size = 10; SalesPersonIdOperatorProperty.EnumType = "operators"; SalesPersonIdOperatorProperty.HasNullCheck = true; StatusProperty = new EnumByteProperty(this, Status); StatusProperty.Size = 10; StatusProperty.EnumType = "sales order status"; StatusOperatorProperty = new OperatorProperty(this, StatusOperator); StatusOperatorProperty.Size = 10; StatusOperatorProperty.EnumType = "operators"; TerritoryIdProperty = new EnumIntProperty(this, TerritoryId); TerritoryIdProperty.Size = 10; TerritoryIdProperty.EnumType = "sales territory"; TerritoryIdOperatorProperty = new OperatorProperty(this, TerritoryIdOperator); TerritoryIdOperatorProperty.Size = 10; TerritoryIdOperatorProperty.EnumType = "operators"; TerritoryIdOperatorProperty.HasNullCheck = true; TotalDueProperty = new MoneyProperty(this, TotalDue); TotalDue2Property = new MoneyProperty(this, TotalDue2); TotalDueOperatorProperty = new OperatorProperty(this, TotalDueOperator); TotalDueOperatorProperty.Size = 10; TotalDueOperatorProperty.EnumType = "operators"; }
private OperatorProperty ParseProperty(string propertiesText) { OperatorProperty property = OperatorProperty.None; if (propertiesText.Length > 0) { string[] props = propertiesText.Split(','); //stretchy, accent,separator, linebreakstyle=after,largeop, symmetric,movablelimits,fence foreach (string p in props) { switch (p.Trim()) { default: throw new NotSupportedException(); case "stretchy": property |= OperatorProperty.Stretchy; break; case "accent": property |= OperatorProperty.Accent; break; case "separator": property |= OperatorProperty.Separator; break; case "linebreakstyle=after": property |= OperatorProperty.LineBreakStyle; break; case "largeop": property |= OperatorProperty.LargeOp; break; case "symmetric": property |= OperatorProperty.Symmetric; break; case "movablelimits": property |= OperatorProperty.MovableLimits; break; case "fence": property |= OperatorProperty.Fence; break; } } } return(property); }
public void ParseAndAddToDictionary(XmlElement xmlElement) { XmlNode ch = xmlElement.ChildNodes.Item(0); XmlNode prop = xmlElement.ChildNodes.Item(7); string op = ParseOperator(ch.InnerText); OperatorProperty properties = ParseProperty(prop.InnerText); if (!Result.ContainsKey(op)) { Result.Add(op, new OperatorInfo() { Operator = op, Properties = properties }); } }
private void AddToDictIfContainProperty(OperatorInfo info, OperatorProperty targetProoerty) { OperatorProperty infoProp = info.Properties; if ((infoProp &= targetProoerty) > 0) { List <OperatorInfo> temp; if (_propertyDict.TryGetValue(targetProoerty, out temp)) { temp.Add(info); } else { List <OperatorInfo> infos = new List <OperatorInfo>(); infos.Add(info); _propertyDict.Add(targetProoerty, infos); } } }
protected override void Initialize() { AccountNumberProperty = new TextProperty(this, AccountNumber); AccountNumberProperty.Size = 10; AccountNumberOperatorProperty = new OperatorProperty(this, AccountNumberOperator); AccountNumberOperatorProperty.Size = 25; AccountNumberOperatorProperty.EnumType = "operators"; PersonNameProperty = new TextProperty(this, PersonName); PersonNameOperatorProperty = new OperatorProperty(this, PersonNameOperator); PersonNameOperatorProperty.Size = 25; PersonNameOperatorProperty.EnumType = "operators"; PersonNameOperatorProperty.HasNullCheck = true; StoreNameProperty = new TextProperty(this, StoreName); StoreNameOperatorProperty = new OperatorProperty(this, StoreNameOperator); StoreNameOperatorProperty.Size = 25; StoreNameOperatorProperty.EnumType = "operators"; StoreNameOperatorProperty.HasNullCheck = true; TerritoryIdProperty = new EnumIntProperty(this, TerritoryId); TerritoryIdProperty.EnumType = "sales territory"; }
private void SeparateToPropertyDict(Dictionary <string, OperatorInfo> opDict) { foreach (var op in opDict) { OperatorInfo info = op.Value; OperatorProperty property = info.Properties; if (property == OperatorProperty.None) { continue; } AddToDictIfContainProperty(info, OperatorProperty.Accent); AddToDictIfContainProperty(info, OperatorProperty.Fence); AddToDictIfContainProperty(info, OperatorProperty.LargeOp); AddToDictIfContainProperty(info, OperatorProperty.LineBreakStyle); AddToDictIfContainProperty(info, OperatorProperty.MovableLimits); AddToDictIfContainProperty(info, OperatorProperty.Separator); AddToDictIfContainProperty(info, OperatorProperty.Stretchy); AddToDictIfContainProperty(info, OperatorProperty.Symmetric); } }
private void AdjustOperators() { // clear operators, for which associated properties are blank foreach (DataProperty p in Properties.Where(p => p is OperatorProperty).ToList()) { OperatorProperty op = p as OperatorProperty; bool isBlank = true; foreach (string nm in new string[] { op.AdditionalPropertyName, op.AdditionalPropertyName2 }) { if (nm != null && HasProperty(nm) && !this[nm].IsNull()) { isBlank = false; } } if (isBlank) { op.SetValue(null); } } }
/// <summary> /// Sets values from the given collection and adjusts values for operators /// </summary> /// <param name="nvc">Collection to set values from</param> public override void SetValues(NameValueCollection nvc) { base.SetValues(nvc); // clear operators, for which associated properties are blank foreach (DataProperty p in Properties.Where(p => p is OperatorProperty).ToList()) { OperatorProperty op = p as OperatorProperty; bool isBlank = true; foreach (string nm in new string[] { op.AdditionalPropertyName, op.AdditionalPropertyName2 }) { if (nm != null && HasProperty(nm) && !this[nm].IsNull()) { isBlank = false; } } if (isBlank) { op.SetValue(null); } } }
set => SetValue(OperatorProperty, value);
protected override void Initialize() { SalesOrderNumberOperatorProperty = new OperatorProperty(this, SalesOrderNumberOperator) { Size = 25, EnumType = "operators", }; SalesOrderNumberProperty = new TextProperty(this, SalesOrderNumber) { Size = 25, }; StatusOperatorProperty = new OperatorProperty(this, StatusOperator) { Size = 25, EnumType = "operators", }; StatusProperty = new EnumByteProperty(this, Status) { IsMultiValued = true, EnumType = "sales order status", }; OrderDateOperatorProperty = new OperatorProperty(this, OrderDateOperator) { Size = 25, EnumType = "operators", }; OrderDateProperty = new DateProperty(this, OrderDate) { }; OrderDate2Property = new DateProperty(this, OrderDate2) { }; DueDateOperatorProperty = new OperatorProperty(this, DueDateOperator) { Size = 25, EnumType = "operators", }; DueDateProperty = new DateProperty(this, DueDate) { }; DueDate2Property = new DateProperty(this, DueDate2) { }; TotalDueOperatorProperty = new OperatorProperty(this, TotalDueOperator) { Size = 25, EnumType = "operators", }; TotalDueProperty = new MoneyProperty(this, TotalDue) { }; TotalDue2Property = new MoneyProperty(this, TotalDue2) { }; CustomerStoreOperatorProperty = new OperatorProperty(this, CustomerStoreOperator) { Size = 25, EnumType = "operators", HasNullCheck = true, }; CustomerStoreProperty = new TextProperty(this, CustomerStore) { }; CustomerNameOperatorProperty = new OperatorProperty(this, CustomerNameOperator) { Size = 25, EnumType = "operators", HasNullCheck = true, }; CustomerNameProperty = new TextProperty(this, CustomerName) { }; GlobalRegionProperty = new EnumProperty(this, GlobalRegion) { Size = 50, EnumType = "sales territory group", }; TerritoryIdOperatorProperty = new OperatorProperty(this, TerritoryIdOperator) { Size = 25, EnumType = "operators", HasNullCheck = true, }; TerritoryIdProperty = new EnumIntProperty(this, TerritoryId) { EnumType = "sales territory", }; SalesPersonIdOperatorProperty = new OperatorProperty(this, SalesPersonIdOperator) { Size = 25, EnumType = "operators", HasNullCheck = true, }; SalesPersonIdProperty = new EnumIntProperty(this, SalesPersonId) { IsMultiValued = true, EnumType = "sales person", }; }