Esempio n. 1
0
    public void AddItem()
    {
        InputTextDialog.Open(
            delegate(byte[] bts)
        {
            //创建文件夹
            IoBuffer ib = new IoBuffer();
            ib.PutBytes(bts);
            string inputFieldText = ib.GetString();
            if (!BeFolderOpen)
            {
                OpenFolder();                                 //没打开的先打开再创建,否则位置错乱
            }
            var ti = TreeItem.Create(inputFieldText, this, MyTreeContainer);


            //nafio add 170623 这段代码有点冗余应该赋值一次就可以,类似重复的代码也需要整理下
//				if (null != MyMenuList.CurSelItem &&
//					!MyMenuList.CurSelItem.Equals (ti))
//				{
//					MyMenuList.CurSelItem.DeSelect();
//				}

            ti.TreeItemID = GEditorRoot.GetIns().KVContainerDic[MyTreeContainer.Name].CreateKVList(MyTreeContainer.Name);


            MyTreeContainer.CurSelItem = ti;
            //ti.OnSelect ();

            Log.i("TreeFolder", "AddItem", "新建item name:" + inputFieldText + " id:" + ti.TreeItemID, BeShowLog);
        }
            );
    }
Esempio n. 2
0
 private void AddItem()
 {
     InputTextDialog.Open(
         delegate(byte[] bts)
     {
         //创建文件夹
         IoBuffer ib = new IoBuffer();
         ib.PutBytes(bts);
         string name         = ib.GetString();
         string _itemID      = GEditorRoot.GetIns().KVContainerDic[MyTreeContainer.Name].CreateKVList(MyTreeContainer.Name);
         var treeItem        = InsertItem(IndexInParentFolder, name, ParentFolder, MyTreeContainer);
         treeItem.TreeItemID = _itemID;
         Log.i("TreeItem", "AddItem", "新建item name:" + name + " id:" + _itemID, BeShowLog);
     }
         );
 }
Esempio n. 3
0
 /// <summary>
 /// 新增文件夹
 /// </summary>
 public void AddFolder()
 {
     InputTextDialog.Open(
         delegate(byte[] bts)
     {
         //创建文件夹
         IoBuffer ib = new IoBuffer();
         ib.PutBytes(bts);
         string inputFieldText = ib.GetString();
         if (!BeFolderOpen)
         {
             OpenFolder();                                 //没打开的先打开再创建,否则位置错乱
         }
         TreeFolder.CreateSubFolder(inputFieldText, this, MyTreeContainer);
     }
         );
 }
Esempio n. 4
0
    public void ReName()
    {
        //base.ReName ();
        InputTextDialog.Open(
            delegate(byte[] bts)
        {
            //创建文件夹
            IoBuffer ib = new IoBuffer();
            ib.PutBytes(bts);
            string newName = ib.GetString();
            Name           = newName;//这个名称不设置的化,当重命名后,再复制黏贴就出问题,显示的是未改名前的名称
            ResizeTextRect(newName);

            //刷TreeContainer的W.这里w的算法,跟上面Create中一致
            float _w = this.CurItemLeftOffset + UIEnum.ItemImageW + 4 + UIEnum.ItemImageW + Tools.GetStringW(this.ItemNameText.text, UIEnum.FontSize);
            MyTreeContainer.SetTreeW(_w);
            MyTreeContainer.RefreshTreeArea();
        }
            );
    }