Пример #1
0
        protected override void InitialSymbol()
        {
            base.InitialSymbol();
            ISymbol         pSymbol      = m_pSimpleRender.Symbol;
            ptSymbolFactory pSymbolFac   = new ptSymbolFactory(pSymbol);
            ptSymbolClass   pSymbolClass = pSymbolFac.GetSymbolClass(m_pSimpleRender.Label, new List <string>()
                                                                     , 0, 0);

            SymbolList.Add(pSymbolClass);
        }
Пример #2
0
        /// <summary>
        /// 初始化符号信息
        /// </summary>
        protected override void InitialSymbol()
        {
            base.InitialSymbol();
            IClassBreaksUIProperties objClassBreaksProp = m_pClassBreaksRender as IClassBreaksUIProperties;

            try
            {
                for (int i = 0; i < BreakCount; i++)
                {
                    double          cLowerLimit  = objClassBreaksProp.LowBreak[i];
                    double          cUpperLimit  = m_pClassBreaksRender.Break[i];
                    ISymbol         pSymbol      = m_pClassBreaksRender.get_Symbol(i);
                    ptSymbolFactory pSymbolFac   = new ptSymbolFactory(pSymbol);
                    ptSymbolClass   pSymbolClass = pSymbolFac.GetSymbolClass(m_pClassBreaksRender.Label[i], new List <string>()
                                                                             , cUpperLimit, cLowerLimit);
                    SymbolList.Add(pSymbolClass);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #3
0
        /// <summary>
        /// 初始化符号信息
        /// </summary>
        protected override void InitialSymbol()
        {
            base.InitialSymbol();

            if (m_pUniqueRender == null || m_pFeatureLayer == null)
            {
                return;
            }
            //是否是多个字段
            bool bNoSepFieldVal = false;
            //是否是连接表
            bool bIsJoined = false;

            try
            {
                IDisplayTable pDisplayTable = m_pFeatureLayer as IDisplayTable;
                ITable        pTable        = pDisplayTable.DisplayTable;
                IDataset      objDataset    = m_FeatureClass as IDataset;
                //是否是关系表
                if (pTable is IRelQueryTable)
                {
                    bIsJoined = true;
                }

                if (FieldCount > 1)
                {
                    bNoSepFieldVal = true;
                }
                //唯一值字段有多个
                if (bNoSepFieldVal)
                {
                    //数据源为SHAPE文件
                    if (objDataset.Workspace.Type == esriWorkspaceType.esriFileSystemWorkspace)
                    {
                        for (int i = 1; i <= FieldCount; i++)
                        {
                            FieldNames.Add(m_pUniqueRender.Field[i - 1].ToLower());
                        }

                        CommStaticClass.GimmeUniqueValuesFromShape(m_FeatureClass as ITable, FieldNames);
                    }
                    //数据源为其他
                    else
                    {
                        for (int i = 1; i <= FieldCount; i++)
                        {
                            FieldNames.Add(m_pUniqueRender.Field[i - 1].ToLower());
                            //属性表有连接表
                            if (pTable is IRelQueryTable)
                            {
                                IRelQueryTable pRelQueryTable     = default(IRelQueryTable);
                                ITable         pDestTable         = default(ITable);
                                IDataset       pDataSet           = default(IDataset);
                                IList <string> alJoinedTableNames = new List <string>();
                                while (pTable is IRelQueryTable)
                                {
                                    pRelQueryTable = pTable as IRelQueryTable;
                                    pDestTable     = pRelQueryTable.DestinationTable;
                                    pDataSet       = pDestTable as IDataset;

                                    pTable = pRelQueryTable.SourceTable;
                                    alJoinedTableNames.Add(pDataSet.Name);
                                }
                                CommStaticClass.GimmeUniqeValuesForFieldname(m_FeatureClass as ITable, m_pUniqueRender.Field[i - 1], alJoinedTableNames);
                                pTable = pDisplayTable.DisplayTable;
                            }
                            //属性表没有连接表
                            else
                            {
                                CommStaticClass.GimmeUniqeValuesForFieldname(m_FeatureClass as ITable, m_pUniqueRender.Field[i - 1]);
                            }
                        }
                    }
                }
                //唯一值字段只有一个
                else
                {
                    FieldNames.Add(m_pUniqueRender.Field[FieldCount - 1].ToLower());
                }

                //开始解析符号
                for (int j = 0; j <= ValueCount - 1; j++)
                {
                    ISymbol         pSymbol      = m_pUniqueRender.get_Symbol(m_pUniqueRender.get_Value(j));
                    ptSymbolFactory pSymbolFac   = new ptSymbolFactory(pSymbol);
                    ptSymbolClass   pSymbolClass = pSymbolFac.GetSymbolClass(m_pUniqueRender.Label[m_pUniqueRender.get_Value(j)], CommStaticClass.getUVFieldValues(m_pUniqueRender, j)
                                                                             , 0, 0);
                    SymbolList.Add(pSymbolClass);
                }
            }
            catch (Exception ex)
            {
                ptLogManager.WriteMessage(string.Format("方法名称:{0}{1}{2}{3}{4}", "InitialSymbol", Environment.NewLine, ex.Message, Environment.NewLine, ex.StackTrace));
            }
        }