Exemplo n.º 1
0
        public static Dictionary <string, object> GetListAndCountOfCategories()        //Работает!
        {
            var guid = Guid.NewGuid();
            MgCoordinateSystemFactory            coordSysFactory = new MgCoordinateSystemFactory();
            MgCoordinateSystemCatalog            csCatalog       = coordSysFactory.GetCatalog();
            MgCoordinateSystemCategoryDictionary csDictCat       = csCatalog.GetCategoryDictionary();

            MgCoordinateSystemEnum csDictCatEnum = csDictCat.GetEnum();
            int csCatCount = csDictCat.GetSize();
            MgStringCollection csCatNames     = csDictCatEnum.NextName(csCatCount);
            string             csCategoryName = null;

            List <string> csCatNamesL = new List <string>();

            for (int i3 = 0; i3 < csCatCount; i3++)
            {
                csCategoryName = csCatNames.GetItem(i3);
                csCatNamesL.Add(csCategoryName);
            }
            return(new Dictionary <string, object>
            {
                { "CatCount", csCatCount },
                { "CatList", csCatNamesL },
            });
        }
Exemplo n.º 2
0
        /// <summary>
        /// Node RenameCurrentCategory rename Category form MapCSLibrary
        /// </summary>
        /// <param name="new_cat_name"></param>
        /// <param name="old_cat_name"></param>
        public static void RenameCurrentCategory(string new_cat_name, string old_cat_name)         //Работает!
        {
            MgCoordinateSystemFactory            coordSysFactory = new MgCoordinateSystemFactory();
            MgCoordinateSystemCatalog            csCatalog       = coordSysFactory.GetCatalog();
            MgCoordinateSystemCategoryDictionary csDictCat       = csCatalog.GetCategoryDictionary();

            csDictCat.Rename(old_cat_name, new_cat_name);
        }