Пример #1
0
        public frmSymbology(byte[] rendererValue, string rendererType, ESRI.ArcGIS.Controls.esriSymbologyStyleClass pStyleClass, List <ESRI.ArcGIS.Geodatabase.IField> pFields)
        {
            m_FeatureLayer    = null;
            m_StyleClass      = pStyleClass;
            m_RendererObject  = new Dictionary <string, IRendererUI>();
            m_FeatureRenderer = GetRenderer(rendererValue, rendererType);
            m_FieldInfo       = new List <FieldInfo>();
            FieldInfo noneField = new FieldInfo();

            noneField.FieldName = "<NONE>";
            noneField.FieldDesc = "<NONE>";
            noneField.FieldType = ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeDate;
            m_FieldInfo.Add(noneField);

            if (pFields != null && pFields.Count != 0)
            {
                for (int i = 0; i < pFields.Count; i++)
                {
                    FieldInfo field = new FieldInfo();
                    //if ((pFields[i].VarType > 1 && pFields[i].VarType < 6 && pFields[i].Type != ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeOID)
                    //                || pFields[i].Type == ESRI.ArcGIS.Geodatabase.esriFieldType.esriFieldTypeString)
                    if ((int)pFields[i].Type < 5)
                    {
                        field.FieldName = pFields[i].Name;
                        field.FieldDesc = pFields[i].AliasName;
                        field.FieldType = pFields[i].Type;
                        m_FieldInfo.Add(field);
                    }
                }
            }

            InitializeUI();
            InitRendererUI(m_FieldInfo);
        }
Пример #2
0
 /// <summary>
 /// 从二进制获取符号方案
 /// </summary>
 /// <param name="renderValue"></param>
 /// <returns></returns>
 private ESRI.ArcGIS.Carto.IFeatureRenderer GetRenderer(byte[] renderValue, string rendererType)
 {
     ESRI.ArcGIS.Carto.IFeatureRenderer pRenderer = ModuleCommon.LoadRendererFromByte(renderValue, rendererType);
     if (pRenderer == null)
     {
         pRenderer = ModuleCommon.CreateSimpleRenderer(m_StyleClass);
     }
     return(pRenderer);
 }
Пример #3
0
        private void CreateRendererObject(string typeString)
        {
            if (m_RendererObject.ContainsKey(typeString))
            {
                return;
            }
            try
            {
                Type type = Type.GetType(typeString);
                if (type == null)
                {
                    return;
                }
                IRendererUI rendererObject = Activator.CreateInstance(type) as IRendererUI;

                ESRI.ArcGIS.Carto.IFeatureRenderer pRenderer = null;
                switch (rendererObject.RendererType)
                {
                case enumRendererType.SimpleRenderer:
                    pRenderer = ModuleCommon.CreateSimpleRenderer(m_StyleClass);
                    break;

                case enumRendererType.UniqueValueRenderer:
                    pRenderer = ModuleCommon.CreateUVRenderer(m_StyleClass);
                    break;

                case enumRendererType.BreakColorRenderer:
                    pRenderer = ModuleCommon.CreateBreakColorRenderer(m_StyleClass);
                    break;

                case enumRendererType.BreakSizeRenderer:
                    pRenderer = ModuleCommon.CreateBreakSizeRenderer(m_StyleClass);
                    break;

                case enumRendererType.ChartRenderer:
                    pRenderer = ModuleCommon.CreateChartRenderer(m_StyleClass);    //yjl20110830 add
                    break;
                }

                if (m_FeatureLayer == null)
                {
                    rendererObject.InitRendererObject(m_FieldInfo, pRenderer, m_StyleClass);
                }
                else
                {
                    rendererObject.InitRendererObject(m_FeatureLayer, pRenderer, m_StyleClass);
                }
                m_RendererObject.Add(typeString, rendererObject);
            }
            catch (Exception ex)
            {
            }
        }
Пример #4
0
        public frmSymbology(ESRI.ArcGIS.Carto.IFeatureLayer pFeatureLayer)
        {
            InitializeComponent();
            m_FeatureLayer = pFeatureLayer;
            if (m_FeatureLayer == null)
            {
                return;
            }
            m_StyleClass      = GetSymbolStyle(pFeatureLayer);
            m_RendererObject  = new Dictionary <string, IRendererUI>();
            m_FeatureRenderer = GetRenderer(m_FeatureLayer);
            m_FieldInfo       = null;

            InitializeUI();
            InitRendererUI(m_FieldInfo);
        }