Beispiel #1
0
        public PredefinedSymbol Add(string name)
        {
            PredefinedSymbol predefinedSymbol = new PredefinedSymbol();

            predefinedSymbol.Name = name;
            this.Add(predefinedSymbol);
            return(predefinedSymbol);
        }
Beispiel #2
0
        public override object GetValue(object component)
        {
            PredefinedSymbol predefinedSymbol = (PredefinedSymbol)component;

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

            if (this.Name == "FromValue")
            {
                predefinedSymbol.FromValue = Field.ToStringInvariant(value);
            }
            else
            {
                predefinedSymbol.ToValue = Field.ToStringInvariant(value);
            }
        }
        private Field GetField(PredefinedSymbol predefinedSymbol)
        {
            if (predefinedSymbol == null)
            {
                return(null);
            }
            RuleBase rule = predefinedSymbol.GetRule();

            if (rule == null)
            {
                return(null);
            }
            return(rule.GetField());
        }
Beispiel #5
0
 protected override void OnInsertComplete(int index, object value)
 {
     base.OnInsertComplete(index, value);
     PredefinedSymbol predefinedSymbol = (PredefinedSymbol)value;
 }
Beispiel #6
0
 public void Remove(PredefinedSymbol value)
 {
     base.List.Remove(value);
 }
Beispiel #7
0
 public int Add(PredefinedSymbol value)
 {
     return(base.List.Add(value));
 }
Beispiel #8
0
        public void UpdateAutoRanges()
        {
            foreach (PredefinedSymbol predefinedSymbol5 in this.PredefinedSymbols)
            {
                predefinedSymbol5.AffectedSymbols.Clear();
            }
            MapCore mapCore = base.GetMapCore();

            if (mapCore != null && mapCore.Symbols.Count != 0 && this.PredefinedSymbols.Count != 0)
            {
                if (this.SymbolField == "(Name)")
                {
                    int num = 0;
                    foreach (Symbol symbol3 in mapCore.Symbols)
                    {
                        if (num == this.PredefinedSymbols.Count)
                        {
                            break;
                        }
                        PredefinedSymbol predefinedSymbol2 = this.PredefinedSymbols[num++];
                        predefinedSymbol2.FromValueInt = symbol3.Name;
                        predefinedSymbol2.ToValueInt   = symbol3.Name;
                    }
                    this.UpdateColorSwatchAndLegend();
                }
                else
                {
                    Field field = this.GetField();
                    if (field != null)
                    {
                        if (field.IsNumeric())
                        {
                            int    count = this.PredefinedSymbols.Count;
                            object obj   = null;
                            object obj2  = null;
                            if (this.FromValue != string.Empty)
                            {
                                obj = field.Parse(this.FromValue);
                            }
                            if (this.ToValue != string.Empty)
                            {
                                obj2 = field.Parse(this.ToValue);
                            }
                            if (obj == null || obj2 == null)
                            {
                                this.GetRangeFromSymbols(field, count, ref obj, ref obj2);
                            }
                            object[] array  = null;
                            object[] array2 = null;
                            if (this.DataGrouping == DataGrouping.EqualInterval)
                            {
                                base.GetEqualIntervals(field, obj, obj2, count, ref array, ref array2);
                            }
                            else if (this.DataGrouping == DataGrouping.EqualDistribution)
                            {
                                ArrayList sortedValues = this.GetSortedValues(field, obj, obj2);
                                base.GetEqualDistributionIntervals(field, sortedValues, obj, obj2, count, ref array, ref array2);
                            }
                            else if (this.DataGrouping == DataGrouping.Optimal)
                            {
                                ArrayList sortedValues2 = this.GetSortedValues(field, obj, obj2);
                                base.GetOptimalIntervals(field, sortedValues2, obj, obj2, count, ref array, ref array2);
                            }
                            int num3 = 0;
                            foreach (PredefinedSymbol predefinedSymbol6 in this.PredefinedSymbols)
                            {
                                if (num3 < array.Length)
                                {
                                    predefinedSymbol6.FromValueInt = AspNetCore.Reporting.Map.WebForms.Field.ToStringInvariant(array[num3]);
                                    predefinedSymbol6.ToValueInt   = AspNetCore.Reporting.Map.WebForms.Field.ToStringInvariant(array2[num3]);
                                    predefinedSymbol6.VisibleInt   = true;
                                }
                                else
                                {
                                    predefinedSymbol6.FromValueInt = AspNetCore.Reporting.Map.WebForms.Field.ToStringInvariant(array2[array2.Length - 1]);
                                    predefinedSymbol6.ToValueInt   = AspNetCore.Reporting.Map.WebForms.Field.ToStringInvariant(array2[array2.Length - 1]);
                                    predefinedSymbol6.VisibleInt   = false;
                                }
                                num3++;
                            }
                        }
                        else if (field.Type == typeof(string))
                        {
                            Hashtable hashtable = new Hashtable();
                            foreach (Symbol symbol4 in base.GetMapCore().Symbols)
                            {
                                if (symbol4.Category == this.Category)
                                {
                                    string text = (string)symbol4[field.Name];
                                    if (text != null)
                                    {
                                        hashtable[text] = 0;
                                    }
                                }
                            }
                            ArrayList arrayList = new ArrayList();
                            arrayList.AddRange(hashtable.Keys);
                            arrayList.Sort();
                            int num4 = 0;
                            foreach (object item in arrayList)
                            {
                                if (num4 == this.PredefinedSymbols.Count)
                                {
                                    break;
                                }
                                PredefinedSymbol predefinedSymbol4 = this.PredefinedSymbols[num4++];
                                predefinedSymbol4.FromValueInt = (string)item;
                                predefinedSymbol4.ToValueInt   = (string)item;
                            }
                        }
                        else
                        {
                            this.PredefinedSymbols[0].FromValueInt = "False";
                            this.PredefinedSymbols[0].ToValueInt   = "False";
                            if (this.PredefinedSymbols.Count > 1)
                            {
                                this.PredefinedSymbols[1].FromValueInt = "True";
                                this.PredefinedSymbols[1].ToValueInt   = "True";
                            }
                        }
                        this.UpdateColorSwatchAndLegend();
                    }
                }
            }
        }