コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: wertkh32/gg
        private void HandleAddDelete(GGResult result)
        {
            // RefreshContents(nowindex);
            if (result.GetResultType() == GGResult.RESULT_TYPE.RESULT_ADD)
            {
                if (CmdInvoker.GetTagCount(result.GetTag()) == 1)
                {
                    TEXTBOX_NO++;
                    TagList.Add(result.GetTag());
                    DeletedTagLists.Add(false);
                    NewRichTextBox();

                }
            }
            else if(result.GetResultType() == GGResult.RESULT_TYPE.RESULT_REMOVE) //delete
            {
                if (CmdInvoker.GetTagCount(result.GetTag()) == -1)
                {
                    TEXTBOX_NO--;
                    int index = GetTagIndex(result.GetTag());
                    DeletedTagLists[index] = true;
                    TagList.RemoveAt(index);
                    RTBIndex = GetPrevIndex();
                    RTBIndex = GetNextIndex();

                }
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: wertkh32/gg
        public void HandleCmd(GGResult result)
        {
            txtError.Clear();
            RTBNow.Document.Blocks.Clear();

            if (result.GetResultType() == GGResult.RESULT_TYPE.RESULT_LIST)
            {
                HandleList(result);
            }
            else if (result.GetResultType() == GGResult.RESULT_TYPE.RESULT_ADD || result.GetResultType() == GGResult.RESULT_TYPE.RESULT_REMOVE)
            {
                HandleAddDelete(result);
            }
            else if (result.GetResultType() == GGResult.RESULT_TYPE.RESULT_UPDATE)
            {
                HandleUpdate(result);
            }
            else if (result.GetResultType() == GGResult.RESULT_TYPE.RESULT_SYNC)
            {
                HandleSync();
            }

            if (result.GetResultType() != GGResult.RESULT_TYPE.RESULT_LIST) RefreshContents(RTBIndex);

            txtError.Text = result.GetNotice();
            if (result.GetNotice() != String.Empty) FadeInAndOut(txtError);
            HistoryList.Add(txtCmdLine.Text);
            if (HistoryList.Count > 10) HistoryList.RemoveAt(0);
            HistoryListIndex = 0;
            txtCmdLine.Text = "";
        }