Beispiel #1
0
        private void method_0(int int_0, IPageLayout ipageLayout_0)
        {
            ElementsTableStruct struct2 = new ElementsTableStruct();
            ITable       table          = AppConfigInfo.OpenTable(struct2.TableName);
            IQueryFilter queryFilter    = new QueryFilterClass
            {
                WhereClause = struct2.TemplateIDFieldName + "=" + int_0.ToString()
            };
            ICursor o = table.Search(queryFilter, false);

            for (IRow row = o.NextRow(); row != null; row = o.NextRow())
            {
                IElement element = this.method_3(row, ipageLayout_0);
                if (element != null)
                {
                    (this._hookHelper.PageLayout as IGraphicsContainer).AddElement(element, -1);
                }
            }
            ComReleaser.ReleaseCOMObject(o);
            o = null;
        }
Beispiel #2
0
        private IElement method_3(IRow irow_0, IPageLayout ipageLayout_0)
        {
            ITable table = irow_0.Table;
            ElementsTableStruct struct2 = new ElementsTableStruct();
            object   obj2    = irow_0.get_Value(table.FindField(struct2.AttributesFieldName));
            IElement element = this.method_2(obj2);

            if (element is ITextElement)
            {
                string text = (element as ITextElement).Text;
                if (text[0] == '=')
                {
                    string[] strArray = text.Substring(1, text.Length - 1).Split(new char[] { '!' });
                    if (strArray[0] == "Field")
                    {
                        string   str3;
                        string   str4;
                        string   str2      = "";
                        string[] strArray2 = strArray[1].Split(new char[] { '.' });
                        if (strArray2.Length > 2)
                        {
                            str2 = strArray2[0];
                            str3 = strArray2[1].Substring(1, strArray2[0].Length - 2);
                            str4 = strArray2[2].Substring(1, strArray2[1].Length - 2);
                        }
                        else
                        {
                            str3 = strArray2[0].Substring(1, strArray2[0].Length - 2);
                            str4 = strArray2[1].Substring(1, strArray2[1].Length - 2);
                        }
                        string       str5        = "";
                        IQueryFilter queryFilter = null;
                        if (strArray.Length >= 3)
                        {
                            queryFilter = new QueryFilterClass();
                            string[] strArray3 = strArray[2].Split(new char[] { '#' });
                            int      index     = 0;
                            bool     flag      = true;
                            for (index = 0; index < strArray3.Length; index++)
                            {
                                if (flag)
                                {
                                    str5 = str5 + " " + strArray3[index];
                                }
                                else
                                {
                                    str5 = str5 + " " + this.hashtable_0[strArray3[index]].ToString();
                                }
                                flag = !flag;
                            }
                            queryFilter.WhereClause = str5;
                        }
                        try
                        {
                            ITable          table2     = ((irow_0.Table as IDataset).Workspace as IFeatureWorkspace).OpenTable(str3);
                            ICursor         o          = table2.Search(queryFilter, false);
                            IDataStatistics statistics = null;
                            statistics = new DataStatisticsClass
                            {
                                Field  = str4,
                                Cursor = o
                            };
                            IStatisticsResults results = statistics.Statistics;
                            string             str6    = str2;
                            switch (str6)
                            {
                            case null:
                                break;

                            case "SUM":
                                (element as ITextElement).Text = results.Sum.ToString();
                                goto Label_034E;

                            case "MAX":
                                (element as ITextElement).Text = results.Maximum.ToString();
                                goto Label_034E;

                            case "MIN":
                                (element as ITextElement).Text = results.Minimum.ToString();
                                goto Label_034E;

                            default:
                                if (str6 != "STD")
                                {
                                    if (str6 != "MEAN")
                                    {
                                        break;
                                    }
                                    (element as ITextElement).Text = results.Mean.ToString();
                                }
                                else
                                {
                                    (element as ITextElement).Text = results.StandardDeviation.ToString();
                                }
                                goto Label_034E;
                            }
                            IRow row = o.NextRow();
                            if (row != null)
                            {
                                try
                                {
                                    string str7 = row.get_Value(table2.FindField(str4)).ToString();
                                    (element as ITextElement).Text = str7;
                                }
                                catch
                                {
                                }
                            }
Label_034E:
                            ComReleaser.ReleaseCOMObject(o);
                        }
                        catch
                        {
                        }
                    }
                    else if (strArray[0] == "Param")
                    {
                        try
                        {
                            (element as ITextElement).Text = this.hashtable_0[strArray[1]].ToString();
                        }
                        catch
                        {
                        }
                    }
                }
            }
            if (element != null)
            {
                int       num3;
                double    num4;
                double    num5;
                IEnvelope envelope;
                object    obj3 = irow_0.get_Value(table.FindField(struct2.LocationFieldName)).ToString();
                if (obj3 is DBNull)
                {
                    return(element);
                }
                IPoint p = this.method_4(obj3.ToString(), ipageLayout_0, out num3, out num4, out num5);
                if (element is ITextElement)
                {
                    if ((element as IElementProperties).Type == "竖向")
                    {
                        string str8 = this.method_1((element as ITextElement).Text);
                        (element as ITextElement).Text = str8;
                    }
                    element.Geometry = p;
                    return(element);
                }
                if (element is IMapSurroundFrame)
                {
                    envelope = element.Geometry.Envelope;
                    envelope.CenterAt(p);
                    element.Geometry = envelope;
                    return(element);
                }
                envelope = element.Geometry.Envelope;
                envelope.CenterAt(p);
                element.Geometry = envelope;
            }
            return(element);
        }