Example #1
0
        void TaggedValueListClick(object sender, EventArgs e)
        {
            ListBox touchedList = (ListBox)sender;

            // selectedMethod = (MethodVO)touchedList.Tag;
            // selectedAttribute = null;

            DiffPresenter.updateEaTaggedValueObject(myElement, selectedTag);

            this.Close();
        }
Example #2
0
        void ReflectToEAToolStripMenuItemClick(object sender, EventArgs e)
        {
            EA.Repository repo = ProjectSetting.getVO().eaRepo;

            if (repo != null)
            {
                // 選択された属性に対する更新処理
                if (selectedAttribute != null)
                {
                    //メッセージボックスを表示する
                    DialogResult result = MessageBox.Show("EAのリポジトリの属性を上書き、もしくは追加します。よろしいですか?",
                                                          "質問",
                                                          MessageBoxButtons.YesNoCancel,
                                                          MessageBoxIcon.Exclamation,
                                                          MessageBoxDefaultButton.Button1);

                    //何が選択されたか調べる
                    if (result == DialogResult.Yes)
                    {
                        DiffPresenter.updateEaAttributeObject(myElement, selectedAttribute);
                    }
                    else
                    {
                        return;
                    }
                }

                // 選択された操作に対する更新処理
                if (selectedMethod != null)
                {
                    //メッセージボックスを表示する
                    DialogResult result = MessageBox.Show("EAのリポジトリの操作を上書き、もしくは追加します。よろしいですか?",
                                                          "質問",
                                                          MessageBoxButtons.YesNoCancel,
                                                          MessageBoxIcon.Exclamation,
                                                          MessageBoxDefaultButton.Button1);

                    //何が選択されたか調べる
                    if (result == DialogResult.Yes)
                    {
                        DiffPresenter.updateEaMethodObject(myElement, selectedMethod);
                    }
                    else
                    {
                        return;
                    }
                }

                // 選択されたタグ付き値に対する更新処理
                if (selectedTag != null)
                {
                    //メッセージボックスを表示する
                    DialogResult result = MessageBox.Show("EAのリポジトリのタグ付き値を上書き、もしくは追加します。よろしいですか?",
                                                          "質問",
                                                          MessageBoxButtons.YesNoCancel,
                                                          MessageBoxIcon.Exclamation,
                                                          MessageBoxDefaultButton.Button1);

                    //何が選択されたか調べる
                    if (result == DialogResult.Yes)
                    {
                        DiffPresenter.updateEaTaggedValueObject(myElement, selectedTag);
                    }
                    else
                    {
                        return;
                    }
                }
            }
            else
            {
                MessageBox.Show("EAにアタッチしていないため、反映できません");
            }
        }
Example #3
0
        private void addTaggedValueBox(int rowIndex, ArtifactXmlReader reader, TaggedValueVO tgv)
        {
            int           longerLine;
            TaggedValueVO leftTgv   = tgv;
            TaggedValueVO rightTgv  = tgv;
            string        leftText  = "";
            string        rightText = "";
            ListBox       listL     = makeNewListBox();
            ListBox       listR     = makeNewListBox();

            switch (tgv.changed)
            {
            case 'U':
                leftTgv  = reader.readTaggedValueDiffDetail(tgv.guid, "L");
                rightTgv = reader.readTaggedValueDiffDetail(tgv.guid, "R");
                DiffPresenter.getDisagreedTaggedValueDesc(leftTgv, rightTgv, ref leftText, ref rightText);

                leftDiffBuffer  = new StringBuilder();
                rightDiffBuffer = new StringBuilder();
                var simpleDiff = new SimpleDiff <string>(leftText.Split('\n'), rightText.Split('\n'));
                simpleDiff.LineUpdate += new EventHandler <DiffEventArgs <string> >(ElementDiff_LineUpdate);
                simpleDiff.RunDiff();

                leftText  = leftDiffBuffer.ToString();
                rightText = rightDiffBuffer.ToString();

                selectedTag = rightTgv;
                leftDiffBuffer.Clear();
                rightDiffBuffer.Clear();
                break;

            case 'C':
                rightTgv = reader.readTaggedValueDiffDetail(tgv.guid, "R");
                DiffPresenter.getMonoTaggedValueDesc(rightTgv, ref rightText);

                selectedTag = rightTgv;
                break;

            case 'D':
                leftTgv = reader.readTaggedValueDiffDetail(tgv.guid, "L");
                DiffPresenter.getMonoTaggedValueDesc(leftTgv, ref leftText);

                selectedTag = leftTgv;
                break;

            default:
                break;
            }

            longerLine = getLongerLine(leftText, rightText);

            setListItems(listL, leftText);
            setListItems(listR, rightText);
            setListBoxSize(listL, leftText, longerLine);
            setListBoxSize(listR, rightText, longerLine);

            if (tgv.changed == 'D' || tgv.changed == 'U')
            {
                listL.Tag = leftTgv;
                listL.ContextMenuStrip = contextMenuStrip1;
                listL.Click           += new System.EventHandler(this.TaggedValueListClick);
                //					listL.Click += new System.EventHandler(this.MethodTextClick);
            }

            if (tgv.changed == 'C' || tgv.changed == 'U')
            {
                listR.Tag = rightTgv;
                listR.ContextMenuStrip = contextMenuStrip1;
                listR.Click           += new System.EventHandler(this.TaggedValueListClick);
                //					listR.Click += new System.EventHandler(this.MethodTextClick);
            }

            tableLayoutPanel1.Controls.Add(listL, 0, rowIndex);
            tableLayoutPanel1.Controls.Add(listR, 1, rowIndex);

            return;
        }
Example #4
0
        private void addAttributeBox(int rowIndex, ArtifactXmlReader reader, AttributeVO attr)
        {
            int         longerLine;
            AttributeVO leftAttr  = attr;
            AttributeVO rightAttr = attr;
            string      leftText  = "";
            string      rightText = "";
            ListBox     listL     = makeNewListBox();
            ListBox     listR     = makeNewListBox();

            switch (attr.changed)
            {
            case 'U':
                leftAttr  = reader.readAttributeDiffDetail(attr.guid, "L");
                rightAttr = reader.readAttributeDiffDetail(attr.guid, "R");
                DiffPresenter.getDisagreedAttributeDesc(leftAttr, rightAttr, ref leftText, ref rightText);
                selectedAttribute = rightAttr;
                break;

            case 'C':
                rightAttr = reader.readAttributeDiffDetail(attr.guid, "R");
                DiffPresenter.getMonoAttributeDesc(rightAttr, ref rightText);
                selectedAttribute = rightAttr;
                break;

            case 'D':
                leftAttr = reader.readAttributeDiffDetail(attr.guid, "L");
                DiffPresenter.getMonoAttributeDesc(leftAttr, ref leftText);
                selectedAttribute = leftAttr;
                break;

            default:
                break;
            }

            longerLine = getLongerLine(leftText, rightText);

            setListItems(listL, leftText);
            setListItems(listR, rightText);
            setListBoxSize(listL, leftText, longerLine);
            setListBoxSize(listR, rightText, longerLine);

            if (attr.changed == 'D' || attr.changed == 'U')
            {
                listL.Tag = leftAttr;
                listL.ContextMenuStrip = contextMenuStrip1;
                listL.Click           += new System.EventHandler(this.AttributeListClick);
                //					listL.Click += new System.EventHandler(this.AttributeTextClick);
            }

            if (attr.changed == 'C' || attr.changed == 'U')
            {
                listR.Tag = rightAttr;
                listR.ContextMenuStrip = contextMenuStrip1;
                listR.Click           += new System.EventHandler(this.AttributeListClick);
                //					listR.Click += new System.EventHandler(this.AttributeTextClick);
            }

            tableLayoutPanel1.Controls.Add(listL, 0, rowIndex);
            tableLayoutPanel1.Controls.Add(listR, 1, rowIndex);

            return;
        }