📄 propertyprop.cs
字号:
/* ---------------------------------------------------------------------------------------------------
*
* PocketUML v0.01.0016
*
*
* Written by Jie Tang.
* Bug report : jiet@msn.com
*
*
* Copyright 2002 James <jiet@msn.com>
* All rights reserved.
*
* This source file(s) may be redistributed unmodified by any means
* PROVIDING they are not sold for profit without the authors expressed
* written consent, and providing that this notice and the authors name
* and all copyright notices remain intact.
*
* Any use of the software in source or binary forms, with or without
* modification, must include, in the user documentation ("About" box and
* printed documentation) and internal comments to the code, notices to
* the end user as follows:
*
* "Portions Copyright 2002 Tang Jie
*
* An email letting me know that you are using it would be nice as well.
* That's not much to ask considering the amount of work that went into
* this.
*
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED. USE IT AT YOUT OWN RISK. THE AUTHOR ACCEPTS NO
* LIABILITY FOR ANY DATA DAMAGE/LOSS THAT THIS PRODUCT MAY CAUSE.
*
*/
//-----------------------------------------------------------------------------------------------------
// Update Information.
//-----------------------------------------------------------------------------------------------------
///
/// PocketUML Namespace
/// Property specification dialog...
///
/// PocketUML v0.1
/// Created by Jie Tang 04/10/2002.
///
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace PocketUML
{
namespace DataUI
{
using PocketUML.Data;
/// <summary>
/// Summary description for PropertyProp.
/// </summary>
public class PropertyProp : System.Windows.Forms.Form
{
private System.Windows.Forms.TabControl General;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox propertyName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox propertyType;
private System.Windows.Forms.Label propertyParentName;
private System.Windows.Forms.Label fdsa;
private System.Windows.Forms.TextBox inital;
private System.Windows.Forms.RadioButton radioPrivate;
private System.Windows.Forms.RadioButton radioImplementation;
private System.Windows.Forms.RadioButton radioProtected;
private System.Windows.Forms.RadioButton radioPublic;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox propertyDoc;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public PropertyProp()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.General = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.propertyDoc = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.radioImplementation = new System.Windows.Forms.RadioButton();
this.radioPrivate = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioProtected = new System.Windows.Forms.RadioButton();
this.radioPublic = new System.Windows.Forms.RadioButton();
this.inital = new System.Windows.Forms.TextBox();
this.fdsa = new System.Windows.Forms.Label();
this.propertyParentName = new System.Windows.Forms.Label();
this.propertyType = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.propertyName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.General.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// General
//
this.General.Appearance = System.Windows.Forms.TabAppearance.FlatButtons;
this.General.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabPage1});
this.General.HotTrack = true;
this.General.Location = new System.Drawing.Point(8, 8);
this.General.Name = "General";
this.General.SelectedIndex = 0;
this.General.Size = new System.Drawing.Size(344, 288);
this.General.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.propertyDoc,
this.label3,
this.radioImplementation,
this.radioPrivate,
this.groupBox1,
this.inital,
this.fdsa,
this.propertyParentName,
this.propertyType,
this.label2,
this.propertyName,
this.label1});
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(336, 259);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "General";
//
// propertyDoc
//
this.propertyDoc.AcceptsReturn = true;
this.propertyDoc.AcceptsTab = true;
this.propertyDoc.AutoSize = false;
this.propertyDoc.Location = new System.Drawing.Point(8, 176);
this.propertyDoc.Name = "propertyDoc";
this.propertyDoc.ReadOnly = true;
this.propertyDoc.Size = new System.Drawing.Size(320, 80);
this.propertyDoc.TabIndex = 13;
this.propertyDoc.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 160);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(88, 16);
this.label3.TabIndex = 12;
this.label3.Text = "Documentation:";
//
// radioImplementation
//
this.radioImplementation.Enabled = false;
this.radioImplementation.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.radioImplementation.Location = new System.Drawing.Point(216, 128);
this.radioImplementation.Name = "radioImplementation";
this.radioImplementation.Size = new System.Drawing.Size(104, 16);
this.radioImplementation.TabIndex = 10;
this.radioImplementation.Text = "Implementation";
//
// radioPrivate
//
this.radioPrivate.Enabled = false;
this.radioPrivate.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.radioPrivate.Location = new System.Drawing.Point(152, 128);
this.radioPrivate.Name = "radioPrivate";
this.radioPrivate.Size = new System.Drawing.Size(64, 16);
this.radioPrivate.TabIndex = 9;
this.radioPrivate.Text = "Private";
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.radioProtected,
this.radioPublic});
this.groupBox1.Location = new System.Drawing.Point(8, 104);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(320, 48);
this.groupBox1.TabIndex = 11;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Export Control";
//
// radioProtected
//
this.radioProtected.Enabled = false;
this.radioProtected.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.radioProtected.Location = new System.Drawing.Point(72, 24);
this.radioProtected.Name = "radioProtected";
this.radioProtected.Size = new System.Drawing.Size(72, 16);
this.radioProtected.TabIndex = 1;
this.radioProtected.Text = "Protected";
//
// radioPublic
//
this.radioPublic.Enabled = false;
this.radioPublic.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.radioPublic.Location = new System.Drawing.Point(8, 24);
this.radioPublic.Name = "radioPublic";
this.radioPublic.Size = new System.Drawing.Size(56, 16);
this.radioPublic.TabIndex = 0;
this.radioPublic.Text = "Public";
//
// inital
//
this.inital.Location = new System.Drawing.Point(72, 80);
this.inital.Name = "inital";
this.inital.ReadOnly = true;
this.inital.Size = new System.Drawing.Size(256, 20);
this.inital.TabIndex = 6;
this.inital.Text = "";
//
// fdsa
//
this.fdsa.Location = new System.Drawing.Point(8, 80);
this.fdsa.Name = "fdsa";
this.fdsa.Size = new System.Drawing.Size(72, 16);
this.fdsa.TabIndex = 5;
this.fdsa.Text = "Initial Value:";
//
// propertyParentName
//
this.propertyParentName.Location = new System.Drawing.Point(248, 16);
this.propertyParentName.Name = "propertyParentName";
this.propertyParentName.Size = new System.Drawing.Size(80, 48);
this.propertyParentName.TabIndex = 4;
//
// propertyType
//
this.propertyType.Location = new System.Drawing.Point(72, 48);
this.propertyType.Name = "propertyType";
this.propertyType.Size = new System.Drawing.Size(160, 21);
this.propertyType.TabIndex = 3;
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 48);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 16);
this.label2.TabIndex = 2;
this.label2.Text = "Type:";
//
// propertyName
//
this.propertyName.Location = new System.Drawing.Point(72, 16);
this.propertyName.Name = "propertyName";
this.propertyName.ReadOnly = true;
this.propertyName.Size = new System.Drawing.Size(160, 20);
this.propertyName.TabIndex = 1;
this.propertyName.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Name:";
//
// button1
//
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button1.Location = new System.Drawing.Point(272, 304);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "OK";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// PropertyProp
//
this.AcceptButton = this.button1;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.AutoScroll = true;
this.ClientSize = new System.Drawing.Size(362, 334);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.General});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "PropertyProp";
this.ShowInTaskbar = false;
this.Text = "PropertyProp";
this.Load += new System.EventHandler(this.PropertyProp_Load);
this.General.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void PropertyProp_Load(object sender, System.EventArgs e)
{
if( elementData == null ) return;
// Name
this.Text = "Property specification for " + elementData.Name;
this.propertyParentName.Text = "Class: " + ((ElementData) elementData.Parent).Name;
this.propertyName.Text = elementData.Name;
// Type
this.propertyType.Text = elementData.PhotoType.phototypeType.Split(' ')[0];
// 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;
// Comment
this.propertyDoc.Text = elementData.DocComment;
// Inital Value
if( elementData.ElementType == enumElementType.elementTypeVariable )
this.inital.Text = ((VariableData)elementData).InitExpression.ToString();
else this.inital.Text = elementData.PhotoType.phototypeInitExpression;
}
public ElementData elementData = null;
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -