📄 classprop.cs
字号:
this.PhototypeList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("PhototypeList.ImageStream")));
this.PhototypeList.TransparentColor = System.Drawing.Color.White;
//
// Properties
//
this.Properties.Controls.AddRange(new System.Windows.Forms.Control[] {
this.propertiesList,
this.checkBox2});
this.Properties.Location = new System.Drawing.Point(4, 25);
this.Properties.Name = "Properties";
this.Properties.Size = new System.Drawing.Size(304, 299);
this.Properties.TabIndex = 2;
this.Properties.Text = "Properties";
//
// propertiesList
//
this.propertiesList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.itemIcon,
this.itemName,
this.itemClass,
this.itemType,
this.itemInitial});
this.propertiesList.FullRowSelect = true;
this.propertiesList.GridLines = true;
this.propertiesList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.propertiesList.HoverSelection = true;
this.propertiesList.LargeImageList = this.PhototypeList;
this.propertiesList.Location = new System.Drawing.Point(8, 32);
this.propertiesList.MultiSelect = false;
this.propertiesList.Name = "propertiesList";
this.propertiesList.Size = new System.Drawing.Size(288, 264);
this.propertiesList.SmallImageList = this.PhototypeList;
this.propertiesList.TabIndex = 3;
this.propertiesList.View = System.Windows.Forms.View.Details;
this.propertiesList.DoubleClick += new System.EventHandler(this.OnPropertyDBClick);
//
// itemIcon
//
this.itemIcon.Text = "";
this.itemIcon.Width = 20;
//
// itemName
//
this.itemName.Text = "Name";
this.itemName.Width = 80;
//
// itemClass
//
this.itemClass.Text = "Class";
this.itemClass.Width = 80;
//
// itemType
//
this.itemType.Text = "Type";
//
// itemInitial
//
this.itemInitial.Text = "Initial";
//
// checkBox2
//
this.checkBox2.Enabled = false;
this.checkBox2.Location = new System.Drawing.Point(8, 8);
this.checkBox2.Name = "checkBox2";
this.checkBox2.Size = new System.Drawing.Size(104, 16);
this.checkBox2.TabIndex = 2;
this.checkBox2.Text = "Show inherited";
//
// tabPage1
//
this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.relationsList,
this.checkBox3});
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(304, 299);
this.tabPage1.TabIndex = 3;
this.tabPage1.Text = "Relations";
//
// relationsList
//
this.relationsList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.relationsName,
this.relationsClass,
this.relationsEndClass});
this.relationsList.FullRowSelect = true;
this.relationsList.GridLines = true;
this.relationsList.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.relationsList.HoverSelection = true;
this.relationsList.Location = new System.Drawing.Point(8, 32);
this.relationsList.Name = "relationsList";
this.relationsList.Size = new System.Drawing.Size(288, 264);
this.relationsList.TabIndex = 3;
this.relationsList.View = System.Windows.Forms.View.Details;
//
// relationsName
//
this.relationsName.Text = "Name";
//
// relationsClass
//
this.relationsClass.Text = "Class";
this.relationsClass.Width = 110;
//
// relationsEndClass
//
this.relationsEndClass.Text = "End Class";
this.relationsEndClass.Width = 110;
//
// checkBox3
//
this.checkBox3.Enabled = false;
this.checkBox3.Location = new System.Drawing.Point(8, 8);
this.checkBox3.Name = "checkBox3";
this.checkBox3.Size = new System.Drawing.Size(104, 16);
this.checkBox3.TabIndex = 2;
this.checkBox3.Text = "Show inherited";
//
// OK
//
this.OK.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.OK.Location = new System.Drawing.Point(248, 344);
this.OK.Name = "OK";
this.OK.TabIndex = 1;
this.OK.Text = "OK";
this.OK.Click += new System.EventHandler(this.OK_Click);
//
// ClassProp
//
this.AcceptButton = this.OK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(330, 376);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.OK,
this.ClassTab});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ClassProp";
this.Text = "ClassProp";
this.Load += new System.EventHandler(this.ClassProp_Load);
this.ClassTab.ResumeLayout(false);
this.General.ResumeLayout(false);
this.Methods.ResumeLayout(false);
this.Properties.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
public ElementData elementData = null;
private void OK_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void ClassProp_Load(object sender, System.EventArgs e)
{
if( elementData == null )
{
this.Close();
return;
}
//**** General Page Info ****//
this.className.Text = this.elementData.Name;
this.classDoc.Text = this.elementData.DocComment;
/// Add title
if( this.elementData.ElementType == enumElementType.elementTypeClass )
{
this.Text = "Class specification for " + this.elementData.Name;
this.classStereotype.Text = "Class";
}
else if( this.elementData.ElementType == enumElementType.elementTypeInterface )
{
this.Text = "Interface specification for " + this.elementData.Name;
this.classStereotype.Text = "Interface";
}
else if( this.elementData.ElementType == enumElementType.elementTypeStruct )
{
this.Text = "Struct specification for " + this.elementData.Name;
this.classStereotype.Text = "Struct";
}
//**** Relation Page Info **** //
if( ((ClassData)elementData).BaseList.Count != 0 )
{
for( int nBaseIndex = 0; nBaseIndex < ((ClassData)elementData).BaseList.Count; nBaseIndex ++ )
{
String strBaseName = (String) ((ClassData)elementData).BaseList[nBaseIndex];
ListViewItem item = new ListViewItem("Specialize Class " + strBaseName);
item.SubItems.Add( elementData.Name );
item.SubItems.Add( strBaseName );
this.relationsList.Items.Add( item );
}
}
//**** Methods Page Info **** //
if( elementData.Element.Count > 0 )
{
for( int i = 0 ; i < elementData.Element.Count ; i ++ )
{
ElementData itemData = (ElementData) elementData.Element[i];
if( itemData.ElementType == enumElementType.elementTypeFunction ||
itemData.ElementType == enumElementType.elementTypeDelegate )
{
ListViewItem item = new ListViewItem("");
if( itemData.AccessType == enumElementAccessType.accessTypePrivate ||
itemData.AccessType == enumElementAccessType.accessTypeProjectOrProtected ||
itemData.AccessType == enumElementAccessType.accessTypeProtected )
{
item.ImageIndex = 0;
}
else item.ImageIndex = 1;
// Stereotype
// ******** I don't know shereotype? ********//
// So....
// :)
item.SubItems.Add("");
// Name
item.SubItems.Add(itemData.Name);
// Class
// Maybe means parent class name
item.SubItems.Add( ((ElementData)(itemData.Parent)).Name );
// Return tyep
// Jerry-build here ......
// :(
item.SubItems.Add( itemData.PhotoType.phototypeType.Split(' ')[0] );
// Store the object referenct index
item.SubItems.Add( i.ToString() );
this.methodsList.Items.Add( item );
}
//**** Property Page Info ****//
else if( itemData.ElementType == enumElementType.elementTypeProperty ||
itemData.ElementType == enumElementType.elementTypeVariable )
{
ListViewItem item = new ListViewItem("");
if( itemData.ElementType == enumElementType.elementTypeVariable )
{
if( itemData.AccessType == enumElementAccessType.accessTypePrivate ||
itemData.AccessType == enumElementAccessType.accessTypeProjectOrProtected ||
itemData.AccessType == enumElementAccessType.accessTypeProtected )
{
item.ImageIndex = 3;
}
else item.ImageIndex = 4;
}
else item.ImageIndex = 2;
// Name
item.SubItems.Add( itemData.Name );
// Class
item.SubItems.Add( ( (ElementData)(itemData.Parent) ).Name );
// Type
item.SubItems.Add( itemData.PhotoType.phototypeType.Split(' ')[0] );
// Initial
if( itemData.ElementType == enumElementType.elementTypeVariable )
{
item.SubItems.Add( ((VariableData)itemData).InitExpression.ToString() );
}
else item.SubItems.Add("");
// Store the object referenct index
item.SubItems.Add( i.ToString() );
this.propertiesList.Items.Add( item );
}
}
}
}
/// <summary>
/// Show methods' property
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnMethodDBClick(object sender, System.EventArgs e)
{
// Can't be less than 0 or more than 1
if( this.methodsList.SelectedItems.Count <= 0 && this.methodsList.SelectedItems.Count > 1 )
return;
// Find which method has been clicked
ListViewItem selectedItem = this.methodsList.SelectedItems[0];
String strTemp = (String) selectedItem.SubItems[5].Text;
int nIndex = Convert.ToInt32( strTemp );
MethodProp methodProp = new MethodProp();
methodProp.elementData = (ElementData) elementData.Element[nIndex];
methodProp.ShowDialog();
}
/// <summary>
/// Show Property's property
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnPropertyDBClick(object sender, System.EventArgs e)
{
// Can't be less than 0 or more than 1
if( this.propertiesList.SelectedItems.Count <= 0 &&
this.propertiesList.SelectedItems.Count > 1 )
return;
// Find which property has been clicked
ListViewItem selectedItem = this.propertiesList.SelectedItems[0];
String strTemp = (String) selectedItem.SubItems[5].Text;
int nIndex = Convert.ToInt32( strTemp );
PropertyProp propertyProp = new PropertyProp();
propertyProp.elementData = (ElementData) elementData.Element[nIndex];
propertyProp.ShowDialog();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -