📄 methodprop.cs
字号:
//
this.parentClassName.Location = new System.Drawing.Point(224, 16);
this.parentClassName.Name = "parentClassName";
this.parentClassName.Size = new System.Drawing.Size(88, 72);
this.parentClassName.TabIndex = 3;
//
// methodStereotype
//
this.methodStereotype.Items.AddRange(new object[] {
"Get",
"Set"});
this.methodStereotype.Location = new System.Drawing.Point(88, 80);
this.methodStereotype.Name = "methodStereotype";
this.methodStereotype.Size = new System.Drawing.Size(121, 21);
this.methodStereotype.TabIndex = 7;
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 80);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(64, 16);
this.label3.TabIndex = 6;
this.label3.Text = "Stereotype:";
//
// methodReturn
//
this.methodReturn.Items.AddRange(new object[] {
"Object",
"int",
"float",
"String",
"double",
"long"});
this.methodReturn.Location = new System.Drawing.Point(88, 48);
this.methodReturn.Name = "methodReturn";
this.methodReturn.Size = new System.Drawing.Size(121, 21);
this.methodReturn.TabIndex = 5;
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 48);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 16);
this.label2.TabIndex = 4;
this.label2.Text = "Return Class:";
//
// methodName
//
this.methodName.Location = new System.Drawing.Point(88, 16);
this.methodName.Name = "methodName";
this.methodName.ReadOnly = true;
this.methodName.Size = new System.Drawing.Size(120, 20);
this.methodName.TabIndex = 2;
this.methodName.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 16);
this.label1.TabIndex = 1;
this.label1.Text = "Name:";
//
// Argument
//
this.Argument.Controls.AddRange(new System.Windows.Forms.Control[] {
this.arguments,
this.label5});
this.Argument.Location = new System.Drawing.Point(4, 25);
this.Argument.Name = "Argument";
this.Argument.Size = new System.Drawing.Size(336, 283);
this.Argument.TabIndex = 1;
this.Argument.Text = "Argument";
//
// arguments
//
this.arguments.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.argumentName,
this.argumentType,
this.argumentDefault});
this.arguments.FullRowSelect = true;
this.arguments.GridLines = true;
this.arguments.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.arguments.Location = new System.Drawing.Point(8, 32);
this.arguments.MultiSelect = false;
this.arguments.Name = "arguments";
this.arguments.Size = new System.Drawing.Size(320, 240);
this.arguments.TabIndex = 1;
this.arguments.View = System.Windows.Forms.View.Details;
//
// argumentName
//
this.argumentName.Text = "Name";
this.argumentName.Width = 120;
//
// argumentType
//
this.argumentType.Text = "Type";
this.argumentType.Width = 120;
//
// argumentDefault
//
this.argumentDefault.Text = "Default";
this.argumentDefault.Width = 70;
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 8);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(100, 16);
this.label5.TabIndex = 0;
this.label5.Text = "Arguments:";
//
// button1
//
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button1.Location = new System.Drawing.Point(264, 328);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "OK";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// MethodProp
//
this.AcceptButton = this.button1;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.AutoScroll = true;
this.ClientSize = new System.Drawing.Size(362, 360);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.tabControl1});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MethodProp";
this.Text = "MethodProp";
this.Load += new System.EventHandler(this.MethodProp_Load);
this.tabControl1.ResumeLayout(false);
this.General.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.Argument.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void MethodProp_Load(object sender, System.EventArgs e)
{
if( this.elementData == null ) return;
// **** General Page *****//
// Name
this.Text = "Method specification for " + this.elementData.Name;
this.methodName.Text = (String) this.elementData.Name;
this.parentClassName.Text = "Class: " + (String) ((ElementData)elementData.Parent).Name;
// Return Class
this.methodReturn.Text = ((FunctionData)elementData).PhotoType.phototypeType.Split(' ')[0];
// Stereotype ??? Sorry! Don't know what's that means....
// Access Type
if( elementData.AccessType == enumElementAccessType.accessTypePublic )
this.radioPublic.Checked = true;
if( elementData.AccessType == enumElementAccessType.accessTypePrivate )
this.radioPrivate.Checked = true;
if( elementData.AccessType == enumElementAccessType.accessTypeProjectOrProtected ||
elementData.AccessType == enumElementAccessType.accessTypeProtected )
this.radioProtected.Checked = true;
//*** Don't know what's means function's implementation ***//
// :( //
///////////
///
// **** Argument Page **** //
FunctionData itemData = (FunctionData) elementData;
int startPos = itemData.PhotoType.paramTypes.IndexOf('(')+1;
int endPos = itemData.PhotoType.paramTypes.IndexOf(')');
String parametersType = itemData.PhotoType.paramTypes.Substring( startPos, endPos - startPos );
String[] types = parametersType.Split(',');
startPos = itemData.PhotoType.paramNames.IndexOf('(')+1;
endPos = itemData.PhotoType.paramNames.IndexOf(')');
String parametersNames = itemData.PhotoType.paramNames.Substring( startPos, endPos - startPos );
String[] names = parametersNames.Split(',');
int nIndex = 0;
if( parametersType.Length > 0 && parametersNames.Length > 0 )
{
foreach( string type in types )
{
ListViewItem item = new ListViewItem(names[nIndex]);
// Name
item.SubItems.Add( type );
this.arguments.Items.Add( item );
// Increase index
nIndex ++;
}
}
}
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TabPage General;
private System.Windows.Forms.TabPage Argument;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox methodName;
private System.Windows.Forms.ComboBox methodReturn;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox methodStereotype;
private System.Windows.Forms.Label parentClassName;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ColumnHeader argumentName;
private System.Windows.Forms.ColumnHeader argumentType;
private System.Windows.Forms.ColumnHeader argumentDefault;
private System.Windows.Forms.RadioButton radioPublic;
private System.Windows.Forms.RadioButton radioProtected;
private System.Windows.Forms.RadioButton radioImplementation;
private System.Windows.Forms.RadioButton radioPrivate;
private System.Windows.Forms.ListView arguments;
public ElementData elementData;
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -