Пример #1
0
        public void Load()
        {
            if (this.mapTemplate != null)
            {
                this.mapTemplate.Clear();
            }
            IQueryFilter queryFilter = new QueryFilterClass
            {
                WhereClause = "ClassID=" + this.OID
            };
            ICursor cursor = this.MapTemplateGallery.MapTemplateTable.Search(queryFilter, false);
            IRow    row    = cursor.NextRow();
            int     index  = this.MapTemplateGallery.MapTemplateTable.FindField("Name");

            while (row != null)
            {
                string str = row.get_Value(index).ToString();
                MapCartoTemplateLib.MapTemplate template2 = new MapCartoTemplateLib.MapTemplate(row.OID, this)
                {
                    Name = str
                };
                this.AddMapTemplate(template2);
                row = cursor.NextRow();
            }
            ComReleaser.ReleaseCOMObject(row);
        }
Пример #2
0
 public void RemoveMapTemplate(MapCartoTemplateLib.MapTemplate mapTemplate_0)
 {
     if (((mapTemplate_0 != null) && (this.mapTemplate != null)) && this.mapTemplate.Contains(mapTemplate_0))
     {
         this.mapTemplate.Remove(mapTemplate_0);
     }
 }
Пример #3
0
 public MapTemplateElement(int oid, MapCartoTemplateLib.MapTemplate pMapTemplate)
 {
     this.m_pElement         = null;
     this.MapTemplateGallery = pMapTemplate.MapTemplateGallery;
     this.OID             = oid;
     this.MapTemplate     = pMapTemplate;
     this.ElementLocation = new MapCartoTemplateLib.ElementLocation();
 }
Пример #4
0
 public MapTemplateParam(int id, MapCartoTemplateLib.MapTemplate pMapTemplate)
 {
     this.MapTemplateGallery = pMapTemplate.MapTemplateGallery;
     this.ParamDataType      = DataType.String;
     this.TempleteGuid       = pMapTemplate.Guid;
     this.OID         = id;
     this.MapTemplate = pMapTemplate;
 }
Пример #5
0
 public MapTemplateElement(MapCartoTemplateLib.MapTemplate pMapTemplate)
 {
     this.m_pElement         = null;
     this.MapTemplateGallery = pMapTemplate.MapTemplateGallery;
     this.OID             = -1;
     this.MapTemplate     = pMapTemplate;
     this.TempleteGuid    = pMapTemplate.Guid;
     this.ElementLocation = new MapCartoTemplateLib.ElementLocation();
 }
Пример #6
0
 public MapTemplateParam Clone(MapCartoTemplateLib.MapTemplate pMapTemplate)
 {
     return(new MapTemplateParam(-1, pMapTemplate)
     {
         TempleteGuid = this.TempleteGuid,
         Name = this.Name,
         AllowNull = this.AllowNull,
         Description = this.Description,
         ParamDataType = this.ParamDataType,
         Value = this.Value
     });
 }
Пример #7
0
 public void AddMapTemplate(MapCartoTemplateLib.MapTemplate mapTemplate_0)
 {
     if (mapTemplate_0 != null)
     {
         if (this.mapTemplate == null)
         {
             this.mapTemplate = new List <MapCartoTemplateLib.MapTemplate>();
         }
         if (!this.mapTemplate.Contains(mapTemplate_0))
         {
             this.mapTemplate.Add(mapTemplate_0);
         }
     }
 }
Пример #8
0
        public static MapTemplateElement CreateMapTemplateElement(IPropertySet pPropertySet,
                                                                  MapCartoTemplateLib.MapTemplate pMapTemplate)
        {
            string typeName = Convert.ToString(pPropertySet.GetProperty("ElementType"));

            MapCartoTemplateLib.MapTemplateGallery mapTemplateGallery = pMapTemplate.MapTemplateGallery;
            Type type = Type.GetType(typeName);

            try
            {
                MapTemplateElement element =
                    Activator.CreateInstance(type, new object[] { -1, pMapTemplate }) as MapTemplateElement;
                element.Load(pPropertySet);
                return(element);
            }
            catch (Exception)
            {
            }
            return(null);
        }
Пример #9
0
        public static MapTemplateElement CreateMapTemplateElement(int id,
                                                                  MapCartoTemplateLib.MapTemplate pMapTemplate)
        {
            MapCartoTemplateLib.MapTemplateGallery mapTemplateGallery = pMapTemplate.MapTemplateGallery;
            IRow row = null;

            row = mapTemplateGallery.MapTemplateElementTable.GetRow(id);
            int  index = row.Fields.FindField("ElementType");
            Type type  = Type.GetType(row.get_Value(index).ToString());

            try
            {
                MapTemplateElement element =
                    Activator.CreateInstance(type, new object[] { id, pMapTemplate }) as MapTemplateElement;
                element.Initlize();
                return(element);
            }
            catch (Exception)
            {
            }
            return(null);
        }
Пример #10
0
 public abstract MapTemplateElement Clone(MapCartoTemplateLib.MapTemplate pMapTemplate);