/// <summary> /// ふるまい情報のインデックステーブルの行追加 /// </summary> private void insertBehaviorTable(MethodVO mth, BehaviorChunk chk) { string sql = @"insert into t_parsed_behavior ( chunkId, methodId, pos, parentId, previousId, indLv, dottedNum, indent, behavior ) values ( @chunkId, @methodId, @pos, @parentId, @previousId, @indLv, @dottedNum, @indent, @behavior ) " ; using (SQLiteCommand command2 = conn.CreateCommand()) { SQLiteParameter[] parameters = new SQLiteParameter[] { new SQLiteParameter("@chunkId", (chk.chunkId)) , new SQLiteParameter("@methodId", chk.methodId) , new SQLiteParameter("@pos", chk.pos) , new SQLiteParameter("@parentId", chk.parentChunkId) , new SQLiteParameter("@previousId", chk.previousChunkId) , new SQLiteParameter("@indLv", chk.indLv) , new SQLiteParameter("@dottedNum", chk.dottedNum) , new SQLiteParameter("@indent", chk.indent) , new SQLiteParameter("@behavior", chk.behavior) }; command2.CommandText = sql; command2.Parameters.AddRange(parameters); command2.ExecuteNonQuery(); } }
private static void Main(string[] args) { bool isAttribute; if (args != null && args.Length >= 5) { string prjfile = "project.bdprj"; if (ProjectSetting.load(args[0] + "\\" + prjfile)) { ElementVO elem = new ElementVO(); elem.guid = args[3]; elem.attributes = new List <AttributeVO>(); elem.methods = new List <MethodVO>(); if (args[1] == "a" || args[1] == "A") { isAttribute = true; } else { isAttribute = false; } char changed; if (args[2] == "C" || args[2] == "U" || args[2] == "D") { changed = args[2][0]; } else { MessageBox.Show("コマンド: DiffViewer <ArtifactPath> <属性:a/操作:m> <CUD> <ElementGuid> <MethodGuid>"); return; } if (isAttribute) { AttributeVO att = new AttributeVO(); att.guid = args[4]; att.changed = changed; elem.attributes.Add(att); } else { MethodVO mth = new MethodVO(); mth.guid = args[4]; mth.changed = changed; elem.methods.Add(mth); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm(elem)); } } else { MessageBox.Show("コマンド: DiffViewer <ArtifactPath> <属性:a/操作:m> <CUD> <ElementGuid> <MethodGuid>"); } }
/// <summary> /// 要素情報のインデックステーブルの行追加 /// </summary> /// <param name="atf"></param> /// <param name="elem"></param> private void insertMthTable(ArtifactVO atf, ElementVO elem, MethodVO mth) { string sql = @"insert into t_attr_mth ( attrMthId, elemId, elemGuid, attrMthFlg, attrMthType, attrMthGuid, attrMthName, attrMthAlias, attrMthNotes, mthParamDesc ) values ( @attrMthId, @elemId, @elemGuid, @attrMthFlg, @attrMthType, @attrMthGuid, @attrMthName, @attrMthAlias, @attrMthNotes, @mthParamDesc ) " ; using (SQLiteCommand command2 = conn.CreateCommand()) { SQLiteParameter[] parameters = new SQLiteParameter[] { new SQLiteParameter("@attrMthId", (mth.methodId)) , new SQLiteParameter("@elemId", elem.elementId) , new SQLiteParameter("@elemGuid", elem.guid) , new SQLiteParameter("@attrMthFlg", "m") , new SQLiteParameter("@attrMthType", mth.returnType) , new SQLiteParameter("@attrMthGuid", mth.guid) , new SQLiteParameter("@attrMthName", mth.name) , new SQLiteParameter("@attrMthAlias", mth.alias) , new SQLiteParameter("@attrMthNotes", mth.notes) , new SQLiteParameter("@mthParamDesc", mth.getParamDesc()) }; command2.CommandText = sql; command2.Parameters.AddRange(parameters); command2.ExecuteNonQuery(); } }
public static bool updateEAMethod(MethodVO mth, Method eaMethodObj) { eaMethodObj.Name = excludeSpecialChar(mth.name); eaMethodObj.Behavior = mth.behavior; eaMethodObj.Notes = mth.notes; return(eaMethodObj.Update()); }
private void outputChangedDetailMethod(ArtifactVO atf, ElementVO elem, MethodVO mth, StreamWriter sw) { sw.Write("\"" + atf.changed + "\""); sw.Write(",\"" + atf.guid + "\""); sw.Write(",\"" + atf.name + "\""); sw.Write(",\"" + atf.pathName + "\""); sw.Write(",\"" + elem.changed + "\""); sw.Write(",\"" + elem.guid + "\""); sw.Write(",\"" + elem.name + "\""); sw.Write(",\"操作\""); sw.Write(",\"" + mth.changed + "\""); sw.Write(",\"" + mth.guid + "\""); sw.Write(",\"" + mth.name + "\""); if (mth.changed == 'D' || mth.changed == 'U') { sw.Write(",\"#method_" + mth.guid.Substring(1, 36) + "_L.xml\""); } else { sw.Write(",\"\""); } if (mth.changed == 'C' || mth.changed == 'U') { sw.Write(",\"#method_" + mth.guid.Substring(1, 36) + "_R.xml\""); } else { sw.Write(",\"\""); } sw.WriteLine(""); }
public BehaviorEditor(ElementVO elementVO, MethodVO methodVO, ElementForm elementForm) { InitializeComponent(); try { using (var reader = new XmlTextReader("jbdl.xshd")) { jpBehaviorEdit.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance); } } catch (Exception ex) { MessageBox.Show("XSHD読み込み処理でエラーが発生しました: " + ex.Message); } jpBehaviorEdit.ShowLineNumbers = true; jpBehaviorEdit.Options.ShowEndOfLine = true; jpBehaviorEdit.Options.ShowSpaces = true; //イベントハンドラを登録 jpBehaviorEdit.TextArea.TextEntered += TextArea_TextEntered; jpBehaviorEdit.TextArea.TextEntering += TextArea_TextEntering; // パラメータで取得した要素、メソッドを自オブジェクト内に保持 element = elementVO; method = methodVO; oldBehaviorValue = methodVO.behavior; this.jpBehaviorEdit.Text = BehaviorPreparator.getParsedBehavior(methodVO.behavior); // this.jpBehaviorEdit.Text = methodVO.behavior; this.parentForm = elementForm; }
/// <summary> /// 片方の操作のダンプ /// </summary> /// <param name="leftAtr"></param> /// <param name="rightAtr"></param> /// <returns></returns> private void getMonoMethodDesc(MethodVO mth, ref string text) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(mth.name + "[" + mth.alias + "]" + "\r\n"); sb.Append(mth.guid + "\r\n"); sb.Append("stereoType=" + mth.stereoType + "\r\n"); sb.Append("returnType=" + mth.returnType + "\r\n"); sb.Append("visibility=" + mth.visibility + "\r\n"); sb.Append("pos=" + mth.pos + "\r\n"); if (mth.notes != null && !"".Equals(mth.notes)) { sb.Append("[notes]\r\n" + mth.notes + "\r\n"); } if (mth.behavior != null || !"".Equals(mth.behavior)) { sb.Append("[behavior]\r\n" + mth.behavior + "\r\n"); } text = sb.ToString(); return; }
/// <summary> /// コンテキストメニュー:EAに反映 のクリックイベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ReflectToEAToolStripMenuItemClick(object sender, EventArgs e) { EA.Repository repo = ProjectSetting.getVO().eaRepo; if (repo != null) { Control source = contextMenuStrip1.SourceControl; if (source != null) { if (source.Tag is AttributeVO) { AttributeVO att = (AttributeVO)source.Tag; confirmUpdateAttribute(repo, att); } else if (source.Tag is MethodVO) { MethodVO mth = (MethodVO)source.Tag; confirmUpdateMethod(repo, mth); } } } else { MessageBox.Show("EAにアタッチしていないため、反映できません"); } }
/// <summary> /// 編集後の振る舞いを再表示する処理(子画面の振る舞い編集画面から呼び出される) /// </summary> /// <param name="method">再表示対象のメソッド</param> public void repaintFormMethod(MethodVO method) { foreach (TextBox mtxt in methNameList) { if (method == mtxt.Tag) { MethodVO m = (MethodVO)mtxt.Tag; if (m.changed == ' ') { mtxt.Text = m.name; } else { mtxt.Text = "[" + m.changed + "] " + m.name; } } } foreach (TextBox btxt in behaviorTextList) { if (method == btxt.Tag) { MethodVO m = (MethodVO)btxt.Tag; setTextBoxSize(btxt, m.behavior); } } btnCommit.Enabled = true; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="element">対象の要素(Connector取得用)</param> /// <param name="method">対象のメソッド</param> public MethodBehaviorEditForm(ElementVO element, MethodVO method) { this.element = element; this.method = method; InitializeComponent(); }
void MethodListClick(object sender, EventArgs e) { ListBox touchedList = (ListBox)sender; selectedMethod = (MethodVO)touchedList.Tag; selectedAttribute = null; }
/// <summary> /// 文書の末尾に操作の情報を出力する. /// </summary> private void outputMethod(ref Document document, MethodVO changedMethod) { // パラグラフを追加 document.Content.Paragraphs.Add(); addAttributeText(ref document, WdColorIndex.wdBlack, "■操作: " + changedMethod.name + "[" + changedMethod.alias + "]" + "\r\n"); addAttributeText_detail(ref document, WdColorIndex.wdBlack, "ID: " + changedMethod.guid + "\r\n"); addAttributeText_detail(ref document, WdColorIndex.wdBlack, changedMethod.notes + "\r\n"); this.diffBuffer = new StringBuilder(); string leftText, rightText; leftText = changedMethod.srcMethod.behavior; rightText = changedMethod.destMethod.behavior; var simpleDiff = new SimpleDiff <string>(leftText.Split('\n'), rightText.Split('\n')); simpleDiff.LineUpdate += new EventHandler <DiffEventArgs <string> > (BehaviorDiff_LineUpdate); simpleDiff.RunDiff(); // パラグラフを追加 document.Content.Paragraphs.Add(); addAttributeText(ref document, WdColorIndex.wdBlack, "[ふるまい]------------------" + "\r\n"); outputTextWithDiffMarked(ref document, diffBuffer.ToString().Split('\n')); addAttributeText(ref document, WdColorIndex.wdBlack, "------------------" + "\r\n"); }
// メソッドのタグ付き値を出力 private static void outputMethodTags(MethodVO mth, int depth, StreamWriter sw) { if (mth.taggedValues == null || mth.taggedValues.Count <= 0) { return; } sw.WriteLine(indent(depth) + "<taggedValues>"); // 取得できたタグ付き値の情報をファイルに展開する foreach (MethodTagVO tagv in mth.taggedValues) { if ("<memo>".Equals(tagv.tagValue)) { if (tagv.notes != null) { sw.WriteLine(indent(depth) + " <tv guid=\"" + escapeXML(tagv.guid) + "\" name=\"" + escapeXML(tagv.name) + "\" value=\"" + escapeXML(tagv.tagValue) + "\">" + escapeXML(tagv.notes) + "</tv>"); } } else { sw.WriteLine(indent(depth) + " <tv guid=\"" + escapeXML(tagv.guid) + "\" name=\"" + escapeXML(tagv.name) + "\" value=\"" + escapeXML(tagv.tagValue) + "\"/>"); } } sw.WriteLine(indent(depth) + "</taggedValues>"); }
private static void outputMethod(MethodVO mth, int depth, StreamWriter sw) { sw.Write(indent(depth) + "<method "); if (mth.changed != ' ') { sw.Write("changed=\"" + mth.changed + "\" "); } sw.Write("guid=\"" + escapeXML(mth.guid) + "\" "); sw.Write("pos=\"" + mth.pos + "\" "); sw.Write("name=\"" + escapeXML(mth.name) + "\" "); sw.Write("alias=\"" + escapeXML(mth.alias) + "\" "); sw.Write("methodId=\"" + mth.methodId + "\" "); if (mth.stereoType != null) { sw.Write("stereotype=\"" + mth.stereoType + "\" "); } if (mth.classifierID != null) { sw.Write("classifierID=\"" + mth.classifierID + "\" "); } sw.Write("isConst=\"" + mth.isConst + "\" "); sw.Write("isLeaf=\"" + mth.isLeaf + "\" "); sw.Write("isPure=\"" + mth.isPure + "\" "); sw.Write("isQuery=\"" + mth.isQuery + "\" "); sw.Write("isRoot=\"" + mth.isRoot + "\" "); sw.Write("returnIsArray=\"" + mth.returnIsArray + "\" "); sw.Write("stateFlags=\"" + mth.stateFlags + "\""); if (mth.throws != null) { sw.Write(" throws=\"" + mth.throws + "\""); } sw.WriteLine(">"); sw.WriteLine(indent(depth) + " <visibility>" + mth.visibility + "</visibility>"); sw.WriteLine(indent(depth) + " <returnType>" + escapeXML(mth.returnType) + "</returnType>"); // メソッドのタグ付き値の出力 outputMethodTags(mth, depth + 1, sw); // 1.2.3.1.1 メソッドパラメータの出力 outputMethodParams(mth, depth + 1, sw); if (mth.notes != null) { sw.WriteLine(indent(depth) + " <notes>" + escapeXML(mth.notes) + "</notes>"); } if (mth.behavior != null) { sw.WriteLine(indent(depth) + " <behavior>" + escapeXML(mth.behavior) + "</behavior>"); } // 1.2.3.1.2 メソッドのタグ付き値出力 // Call outputMethodTags( mth, resp ); sw.WriteLine(indent(depth) + "</method>"); }
private static void writeMethod(MethodVO method, StreamWriter sw) { sw.WriteLine("//##BEGIN method GUID=" + method.guid + "##"); string stereotypeStr = ""; if (method.stereoType != null && method.stereoType != "") { // stereotypeStr = "«" + method.stereoType + "»"; stereotypeStr = "≪" + method.stereoType + "≫"; } sw.WriteLine("#### 操作 " + stereotypeStr + method.name + "[" + method.alias + "]"); sw.WriteLine("// +GUID: " + method.guid + "+"); sw.WriteLine(""); sw.WriteLine("##### 操作宣言"); sw.WriteLine(""); sw.WriteLine(" " + method.visibility + " " + method.returnType + " " + stereotypeStr + method.name + " (" + method.getParamDesc() + ")"); sw.WriteLine(""); // パラメータの出力 if (method.parameters != null && method.parameters.Count > 0) { writeParameters(method.parameters, sw); } // ノートの出力 if (method.notes != null && method.notes != "") { sw.WriteLine("##### メソッドの概要"); sw.WriteLine(""); sw.WriteLine("[%hardbreaks]"); sw.WriteLine(method.notes); sw.WriteLine(""); // sw.WriteLine("[%hardbreaks]"); // sw.WriteLine("メソッド概要:: " + method.notes + "\r\n"); } // タグ付き値の出力 if (method.taggedValues != null && method.taggedValues.Count > 0) { writeTaggedValueMth(method.taggedValues, sw); } // ふるまいの出力 if (method.behavior != null && method.behavior != "") { sw.WriteLine("##### ふるまい"); sw.WriteLine(""); sw.WriteLine("------"); sw.WriteLine(method.behavior); // sw.WriteLine(getParsedBehavior(method)); sw.WriteLine("------"); sw.WriteLine(""); } sw.WriteLine("//##END method##"); }
/// <summary> /// 操作アイコンクリック時のイベントハンドラ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void MethodSymbolClick(object sender, EventArgs e) { PictureBox targetIcon = (PictureBox)sender; MethodVO methvo = (MethodVO)targetIcon.Tag; MethodPropertyForm methPropForm = new MethodPropertyForm(methvo); methPropForm.Show(this); }
/// <summary> /// 片方の操作のダンプ /// </summary> /// <param name="leftAtr"></param> /// <param name="rightAtr"></param> /// <returns></returns> internal static void getMonoMethodDesc(MethodVO mth, ref string text) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(mth.name + "[" + mth.alias + "]" + "\r\n"); sb.Append(mth.guid + "\r\n"); sb.Append(mth.getComparableString()); text = sb.ToString(); return; }
/// <summary> /// 比較して差異があったメソッドに対して左右それぞれのオリジナル情報を出力し、ピンポイントの比較ができるようにする /// </summary> /// <param name="mth">該当メソッド</param> /// <param name="leftRight"> "L" もしくは "R" を指定する(出力ファイル名のサフィックスになる)</param> private void outputOriginalMethodFile(MethodVO mth, string leftRight) { //BOM無しのUTF8でテキストファイルを作成する StreamWriter mthsw = new StreamWriter(outputDir + "\\detail\\#method_" + mth.guid.Substring(1, 36) + "_" + leftRight + ".xml"); mthsw.WriteLine(@"<?xml version=""1.0"" encoding=""utf-8""?> "); mthsw.WriteLine(""); outputMethod(mth, 0, mthsw); mthsw.Close(); }
public MethodPropertyForm(MethodVO mth) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); // // TODO: Add constructor code after the InitializeComponent() call. // targetMethod = mth; }
/// <summary> /// 差異が検出された2つの操作の不一致な項目=値をつなげた文字列を作成 /// </summary> /// <param name="leftMth">(in)左の操作VO</param> /// <param name="rightMth">(in)右の操作VO</param> /// <param name="leftText">(out)左用の出力テキスト</param> /// <param name="rightText">(out)右用の出力テキスト</param> /// <returns></returns> internal static void getDisagreedMethodDesc(MethodVO leftMth, MethodVO rightMth, ref string leftText, ref string rightText) { System.Text.StringBuilder lsb = new System.Text.StringBuilder(); System.Text.StringBuilder rsb = new System.Text.StringBuilder(); lsb.Append(leftMth.name + "[" + leftMth.alias + "]" + "\r\n"); rsb.Append(rightMth.name + "[" + rightMth.alias + "]" + "\r\n"); lsb.Append(leftMth.guid + "\r\n"); rsb.Append(rightMth.guid + "\r\n"); if (!compareNullable(leftMth.stereoType, rightMth.stereoType)) { lsb.Append("stereoType=" + leftMth.stereoType + "\r\n"); rsb.Append("stereoType=" + rightMth.stereoType + "\r\n"); } if (!compareNullable(leftMth.returnType, rightMth.returnType)) { lsb.Append("returnType=" + leftMth.returnType + "\r\n"); rsb.Append("returnType=" + rightMth.returnType + "\r\n"); } if (!compareNullable(leftMth.visibility, rightMth.visibility)) { lsb.Append("visibility=" + leftMth.visibility + "\r\n"); rsb.Append("visibility=" + rightMth.visibility + "\r\n"); } if (leftMth.pos != rightMth.pos) { lsb.Append("pos=" + leftMth.pos + "\r\n"); rsb.Append("pos=" + rightMth.pos + "\r\n"); } if (!compareNullable(leftMth.notes, rightMth.notes)) { lsb.Append("[notes]\r\n" + leftMth.notes + "\r\n"); rsb.Append("[notes]\r\n" + rightMth.notes + "\r\n"); } if (!compareNullable(leftMth.behavior, rightMth.behavior)) { lsb.Append("[behavior]\r\n" + leftMth.behavior); rsb.Append("[behavior]\r\n" + rightMth.behavior); } leftText = lsb.ToString(); rightText = rsb.ToString(); return; }
/// <summary> /// 引数の操作リストから操作IDでヒットする操作を探し、 /// そのtaggedValuesに取得したタグ付き値リストをセットする /// </summary> /// <param name="methods">属性リスト</param> /// <param name="targetMethodId">属性ID(t_attributetagから取得)</param> /// <param name="startIdx">開始インデックス</param> /// <param name="mtags">属性のタグ付き値リスト</param> /// <returns></returns> private int searchMethodAndSetTags(List <MethodVO> methods, int targetMethodId, int startIdx, List <TaggedValueVO> mtags) { for (int i = startIdx; i < methods.Count; i++) { MethodVO mth = methods[i]; if (mth.methodId == targetMethodId) { mth.taggedValues = mtags; return(i); } } return(startIdx); }
private static string getParsedBehavior(MethodVO mth) { BehaviorParser parser = new BehaviorParser(); List <BehaviorChunk> chunkList = parser.parseBehavior(mth); StringWriter outsw = new StringWriter(); foreach (var bc in chunkList) { outsw.WriteLine(generateIndentStr(bc.indLv) + bc.behavior); } return(outsw.ToString()); }
void AttributeTextClick(object sender, EventArgs e) { TextBox touchedText = (TextBox)sender; if (selectedTextBox != null && selectedTextBox != touchedText) { selectedTextBox.BackColor = Color.LightYellow; } touchedText.BackColor = Color.LightPink; selectedTextBox = touchedText; selectedAttribute = (AttributeVO)touchedText.Tag; selectedMethod = null; }
/// <summary> /// 全属性・操作CSVに操作行を追加 /// </summary> /// <param name="pak">パッケージVO</param> /// <param name="elem">要素VO</param> /// <param name="mth">操作VO</param> /// <param name="csvsw">出力ストリーム</param> private void writeCsvFileMethod(PackageVO pak, ElementVO elem, MethodVO mth, StreamWriter csvsw) { csvsw.Write("" + addQuote(pak.guid)); csvsw.Write("," + addQuote(pak.stereoType)); csvsw.Write("," + addQuote(pak.pathName)); csvsw.Write("," + addQuote(elem.guid)); csvsw.Write("," + addQuote(elem.eaType)); csvsw.Write("," + addQuote(elem.name)); csvsw.Write("," + addQuote(elem.stereoType)); // csvsw.Write("," + elem.tag); csvsw.Write("," + addQuote("m")); csvsw.Write("," + addQuote(mth.guid)); csvsw.Write("," + addQuote(mth.name)); csvsw.Write("," + addQuote(mth.alias)); csvsw.Write("," + addQuote(mth.getParamDesc())); csvsw.Write("\r\n"); }
void MethodTextClick(object sender, EventArgs e) { TextBox touchedText = (TextBox)sender; if (selectedTextBox != null && selectedTextBox != touchedText) { selectedTextBox.BackColor = Color.LightYellow; } touchedText.BackColor = Color.LightPink; selectedTextBox = touchedText; selectedMethod = (MethodVO)touchedText.Tag; // if( selectedMethod != null ) { // MessageBox.Show("操作が選択されました: " + selectedMethod.guid); // } selectedAttribute = null; }
/// <summary> /// メソッド振る舞いのテキストボックスのダブルクリックイベントハンドラ(振る舞い編集画面を開く) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void MethodTextBoxDoubleClick(object sender, EventArgs e) { MethodVO method = (MethodVO)((TextBox)sender).Tag; // Form f = new MethodBehaviorEditForm(myElement, method); // f.ShowDialog(this); var window = new BehaviorEditor(myElement, method); // var window = new BehaviorWindow(); ElementHost.EnableModelessKeyboardInterop(window); window.Show(); if (method.changed == 'U') { this.repaintFormMethod(method); } }
private void insertBehaviorsInMethod(ElementVO elem, MethodVO mth) { // ふるまいを行ごとに切り分け、チャンク単位で登録 List <BehaviorChunk> chunks = bhvParser.parseBehavior(mth); foreach (BehaviorChunk chk in chunks) { insertBehaviorTable(mth, chk); behaviorRecCount++; if (behaviorRecCount > 0 && (behaviorRecCount + 1) % 1000 == 0) { Console.Write("."); transaction.Commit(); transaction = conn.BeginTransaction(); } } }
/// <summary> /// 操作のパラメータを出力。 /// パラメータのStreamに向けてXML文書を出力 /// </summary> /// <param name="mth">操作VO</param> /// <param name="depth">現在のインデントの深さ</param> /// <param name="sw">出力用に開かれたStreamWriter</param> private static void outputMethodParams(MethodVO mth, int depth, StreamWriter sw) { if (mth.parameters == null || mth.parameters.Count <= 0) { return; } sw.WriteLine(indent(depth) + "<parameters>"); // メソッドのパラメータ foreach (ParameterVO prm in mth.parameters) { sw.Write(indent(depth + 1) + "<parameter "); sw.Write("guid=\"" + escapeXML(prm.guid) + "\" "); sw.Write("name=\"" + escapeXML(prm.name) + "\" "); sw.Write("type=\"" + escapeXML(prm.eaType) + "\" "); sw.Write("alias=\"" + escapeXML(prm.alias) + "\" "); sw.Write("stereotype=\"" + escapeXML(prm.stereoType) + "\" "); sw.Write("pos=\"" + prm.pos + "\" "); sw.Write("classifier=\"" + prm.classifierID + "\" "); sw.Write("default=\"" + escapeXML(prm.defaultValue) + "\" "); sw.Write("const=\"" + prm.isConst + "\" "); sw.Write("kind=\"" + prm.kind + "\" "); sw.Write("objectType=\"" + prm.objectType + "\""); sw.WriteLine(">"); if (prm.notes != null) { sw.WriteLine(indent(depth + 2) + "<notes>" + escapeXML(prm.notes) + "</notes>"); } // パラメータのタグ付き値出力 if (prm.paramTags != null) { outputParameterTags(prm, depth + 2, sw); } sw.WriteLine(indent(depth + 1) + "</parameter>"); } sw.WriteLine(indent(depth) + "</parameters>"); }
/// <summary> /// メソッドのコンテキストメニュー-「GUIDをコピー」のクリックイベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void CopyGuidMethodToolStripMenuItemClick(object sender, EventArgs e) { Control source = methodContextMenuStrip.SourceControl; if (source != null) { MethodVO mth = (MethodVO)((Control)source).Tag; EA.Repository repo = ProjectSetting.getVO().eaRepo; try { if (mth != null) { Clipboard.SetText(mth.guid); MessageBox.Show("メソッドのGUIDがクリップボードにコピーされました"); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
/// <summary> /// メソッドのコンテキストメニュー-「EAでこのメソッドを選択」のクリックイベント /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void FocusEAMethodToolStripMenuItemClick(object sender, EventArgs e) { //ContextMenuStripを表示しているコントロールを取得する Control source = methodContextMenuStrip.SourceControl; if (source != null) { MethodVO mth = (MethodVO)((Control)source).Tag; EA.Repository repo = ProjectSetting.getVO().eaRepo; if (mth != null && repo != null) { EA.Method meth = (EA.Method)repo.GetMethodByGuid(mth.guid); if (meth != null) { repo.ShowInProjectView(meth); } } } }