Пример #1
0
        public PredefinedSymbol Add(string name)
        {
            PredefinedSymbol predefinedSymbol = new PredefinedSymbol();

            predefinedSymbol.Name = name;
            Add(predefinedSymbol);
            return(predefinedSymbol);
        }
        public override object GetValue(object component)
        {
            PredefinedSymbol predefinedSymbol = (PredefinedSymbol)component;

            if (Name == "FromValue")
            {
                return(field.Parse(predefinedSymbol.FromValue));
            }
            return(field.Parse(predefinedSymbol.ToValue));
        }
        public override void SetValue(object component, object value)
        {
            PredefinedSymbol predefinedSymbol = (PredefinedSymbol)component;

            if (Name == "FromValue")
            {
                predefinedSymbol.FromValue = Field.ToStringInvariant(value);
            }
            else
            {
                predefinedSymbol.ToValue = Field.ToStringInvariant(value);
            }
        }
Пример #4
0
        internal void UpdateAutoRanges()
        {
            foreach (PredefinedSymbol predefinedSymbol4 in PredefinedSymbols)
            {
                predefinedSymbol4.AffectedSymbols.Clear();
            }
            MapCore mapCore = GetMapCore();

            if (mapCore == null || mapCore.Symbols.Count == 0 || PredefinedSymbols.Count == 0)
            {
                return;
            }
            if (SymbolField == "(Name)")
            {
                int num = 0;
                foreach (Symbol symbol3 in mapCore.Symbols)
                {
                    if (num == PredefinedSymbols.Count)
                    {
                        break;
                    }
                    PredefinedSymbol predefinedSymbol = PredefinedSymbols[num++];
                    predefinedSymbol.FromValueInt = symbol3.Name;
                    predefinedSymbol.ToValueInt   = symbol3.Name;
                }
                UpdateColorSwatchAndLegend();
                return;
            }
            Field field = GetField();

            if (field == null)
            {
                return;
            }
            if (field.IsNumeric())
            {
                int    count = PredefinedSymbols.Count;
                object obj   = null;
                object obj2  = null;
                if (FromValue != string.Empty)
                {
                    obj = field.Parse(FromValue);
                }
                if (ToValue != string.Empty)
                {
                    obj2 = field.Parse(ToValue);
                }
                if (obj == null || obj2 == null)
                {
                    GetRangeFromSymbols(field, count, ref obj, ref obj2);
                }
                object[] fromValues = null;
                object[] toValues   = null;
                if (DataGrouping == DataGrouping.EqualInterval)
                {
                    GetEqualIntervals(field, obj, obj2, count, ref fromValues, ref toValues);
                }
                else if (DataGrouping == DataGrouping.EqualDistribution)
                {
                    ArrayList sortedValues = GetSortedValues(field, obj, obj2);
                    GetEqualDistributionIntervals(field, sortedValues, obj, obj2, count, ref fromValues, ref toValues);
                }
                else if (DataGrouping == DataGrouping.Optimal)
                {
                    ArrayList sortedValues2 = GetSortedValues(field, obj, obj2);
                    GetOptimalIntervals(field, sortedValues2, obj, obj2, count, ref fromValues, ref toValues);
                }
                int num2 = 0;
                foreach (PredefinedSymbol predefinedSymbol5 in PredefinedSymbols)
                {
                    if (num2 < fromValues.Length)
                    {
                        predefinedSymbol5.FromValueInt = Microsoft.Reporting.Map.WebForms.Field.ToStringInvariant(fromValues[num2]);
                        predefinedSymbol5.ToValueInt   = Microsoft.Reporting.Map.WebForms.Field.ToStringInvariant(toValues[num2]);
                        predefinedSymbol5.VisibleInt   = true;
                    }
                    else
                    {
                        predefinedSymbol5.FromValueInt = Microsoft.Reporting.Map.WebForms.Field.ToStringInvariant(toValues[toValues.Length - 1]);
                        predefinedSymbol5.ToValueInt   = Microsoft.Reporting.Map.WebForms.Field.ToStringInvariant(toValues[toValues.Length - 1]);
                        predefinedSymbol5.VisibleInt   = false;
                    }
                    num2++;
                }
            }
            else if (field.Type == typeof(string))
            {
                Hashtable hashtable = new Hashtable();
                foreach (Symbol symbol4 in GetMapCore().Symbols)
                {
                    if (symbol4.Category == Category)
                    {
                        string text = (string)symbol4[field.Name];
                        if (text != null)
                        {
                            hashtable[text] = 0;
                        }
                    }
                }
                ArrayList arrayList = new ArrayList();
                arrayList.AddRange(hashtable.Keys);
                arrayList.Sort();
                int num3 = 0;
                foreach (object item in arrayList)
                {
                    if (num3 == PredefinedSymbols.Count)
                    {
                        break;
                    }
                    PredefinedSymbol predefinedSymbol3 = PredefinedSymbols[num3++];
                    predefinedSymbol3.FromValueInt = (string)item;
                    predefinedSymbol3.ToValueInt   = (string)item;
                }
            }
            else
            {
                PredefinedSymbols[0].FromValueInt = "False";
                PredefinedSymbols[0].ToValueInt   = "False";
                if (PredefinedSymbols.Count > 1)
                {
                    PredefinedSymbols[1].FromValueInt = "True";
                    PredefinedSymbols[1].ToValueInt   = "True";
                }
            }
            UpdateColorSwatchAndLegend();
        }
 private Field GetField(PredefinedSymbol predefinedSymbol)
 {
     return(predefinedSymbol?.GetRule()?.GetField());
 }
Пример #6
0
 public void Remove(PredefinedSymbol value)
 {
     base.List.Remove(value);
 }
Пример #7
0
 public int Add(PredefinedSymbol value)
 {
     return(base.List.Add(value));
 }