Exemplo n.º 1
0
        /// <summary>Загружаем данные слоя</summary>
        /// <param name="wDoc"> xml-файл с данными </param>
        /// <param name="wRule"> правила слоя </param>
        /// <returns></returns>
        internal Data.DataLayer LoadData(XmlDocument wDoc, LayerRule wRule)
        {
            var res = new Data.DataLayer(wRule);

            res.LoadData(wDoc);
            return(res);
        }
Exemplo n.º 2
0
        /// <summary>Создаём таблицу ObjectData.</summary>
        /// <param name="wRule"> LayerRule как источник описания таблицы </param>
        /// <returns> ObjectData.Table </returns>
        public Autodesk.Gis.Map.ObjectData.Table CreateOdTable(Rule.LayerRule wRule)
        {
            var mapApp        = HostMapApplicationServices.Application;
            var activeProject = mapApp.ActiveProject;
            var tableList     = activeProject.ODTables;

            //
            if (!tableList.GetTableNames().Contains(wRule.CorrectName))
            {
                var fieldDefs = mapApp.ActiveProject.MapUtility.NewODFieldDefinitions();
                foreach (var fr in from Rule.FieldRule fr in wRule.FieldList where !fr.IsGeom select fr)
                {
                    fieldDefs.Add(fr.CorrectName, "", Autodesk.Gis.Map.Constants.DataType.Character, 0);//!!1
                }
                tableList.Add(wRule.CorrectName, fieldDefs, "", true);
            }
            //
            return(tableList[wRule.CorrectName]);
        }
Exemplo n.º 3
0
        //Autodesk.Gis.Map.ObjectData.Table crODTable;

        /// <summary>
        /// Создаём таблицу ObjectData.
        /// </summary>
        /// <param name="wRule"> LayerRule как источник описания таблицы </param>
        /// <returns> ObjectData.Table </returns>
        public Autodesk.Gis.Map.ObjectData.Table CreateODTable(Rule.LayerRule wRule)
        {
            Autodesk.Gis.Map.MapApplication       mapApp        = Autodesk.Gis.Map.HostMapApplicationServices.Application;
            Autodesk.Gis.Map.Project.ProjectModel activeProject = mapApp.ActiveProject;
            Autodesk.Gis.Map.ObjectData.Tables    tableList     = activeProject.ODTables;
            //
            if (!tableList.GetTableNames().Contains(wRule.LName))
            {
                FieldDefinitions fieldDefs = mapApp.ActiveProject.MapUtility.NewODFieldDefinitions();
                foreach (Rule.FieldRule fr in wRule.FieldList)
                {
                    if (!fr.IsGeom)
                    {
                        fieldDefs.Add(fr.FName, "", Autodesk.Gis.Map.Constants.DataType.Character, 0); //!!1
                    }
                }
                tableList.Add(wRule.LName, fieldDefs, "", true);
            }
            //
            return(tableList[wRule.LName]);
        }