示例#1
0
        private void OnCreateFolderButtonClick(object sender, RoutedEventArgs e)
        {
            var prompt = new PromptWindow();

            prompt.SetTitle("请输入文件夹名称");
            prompt.OnOk += OnInputFolderNameOk;
            prompt.Show();
        }
示例#2
0
    public void OnCreateRoom()
    {
        SoundManager.Instance.PlayUIButtonClick();
        PromptWindow window = UIFactory.Instance.Create(UI_ELEMENT.PROMPT_WINDOW).GetComponent <PromptWindow>();

        window.Initialize();
        window.AttachUIElement(new Vector2(0, 50), LobbySceneGUI.Instance.lobbyGUI);
        window.SetTitle("생성 할 방의 이름을 입력하시오.");

        window.AddConfirmEventFunc(() => {
            CLIENTtoSERVER_CreateRoomPacketData data = new CLIENTtoSERVER_CreateRoomPacketData();
            data.playerKey = GameFramework.Instance.MyPlayer.PlayerKey;
            data.roomName  = window.GetInputText();
            NetworkManager.Instance.SendCommand((int)PROTOCOL.CREATE_ROOM, (int)EXTRA.REQUEST, data);
        });
    }
示例#3
0
        private void OnRenameContextMenuClick(object sender, RoutedEventArgs e)
        {
            var fse = mouseElement.DataContext as FileSystemEntity;

            if (fse == null)
            {
                return;
            }
            var dlg = new PromptWindow();

            dlg.SetTitle("请输入新的文件夹名称");
            dlg.OnOk += (oo, ee) =>
            {
                string strName = dlg.InputText;
                if (string.IsNullOrEmpty(strName) || strName.Equals(fse.Name, StringComparison.CurrentCultureIgnoreCase))
                {
                    return;
                }
                var source = FileBrowseListBox.ItemsSource as List <FileSystemEntity>;
                if (source != null && source.Any(o => o.Type == FileSystemEntityType.Folder &&
                                                 o.Name.Equals(strName, StringComparison.CurrentCultureIgnoreCase) &&
                                                 o.FolderId != fse.FolderId))
                {
                    CustomMessageBox.Alert("新的文件夹名称与其他文件夹名重复!");
                    return;
                }
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "正在执行...";
                docContext.RenameFolder(fse.FolderId, strName, obj =>
                {
                    BusyIndicator1.IsBusy = false;
                    if (Utility.Utility.CheckInvokeOperation(obj))
                    {
                        if (obj.Value > 0)
                        {
                            fse.Name = strName;
                        }
                        else
                        {
                            CustomMessageBox.Show("重命名失败!错误码:" + obj.Value);
                        }
                    }
                }, null);
            };
            dlg.Show();
        }