Exemplo n.º 1
0
        public void renameLayout(string find, string replace)
        {
            List <string> layouts = new List <string>();

            _Db.DBDictionary lays = _c.trans.GetObject(_c.db.LayoutDictionaryId, _Db.OpenMode.ForWrite) as _Db.DBDictionary;

            foreach (_Db.DBDictionaryEntry item in lays)
            {
                if (item.Key.Contains(find))
                {
                    string name = item.Key;
                    layouts.Add(name);
                }
            }

            if (layouts.Count > 0)
            {
                _Db.LayoutManager lm = _Db.LayoutManager.Current;

                foreach (string lay in layouts)
                {
                    string newname = lay.Replace(find, replace);
                    lm.RenameLayout(lay, newname);
                }


                string       randomName = generateRandomString(40);
                _Db.ObjectId id         = lm.GetLayoutId(randomName);

                if (!id.IsValid)
                {
                    id = lm.CreateLayout(randomName);
                }

                lm.DeleteLayout(randomName);

                lm.Dispose();
            }
        }
Exemplo n.º 2
0
 private void removeLayout(_Db.Layout lay)
 {
     layoutManager.DeleteLayout(lay.LayoutName);
     layoutManager.CurrentLayout = "Model";
 }