本文整理汇总了C#中Behaviac.Design.PropertyDef类的典型用法代码示例。如果您正苦于以下问题:C# PropertyDef类的具体用法?C# PropertyDef怎么用?C# PropertyDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyDef类属于Behaviac.Design命名空间,在下文中一共展示了PropertyDef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MetaPropertyDialog
public MetaPropertyDialog(bool canBeEdited, AgentType agent, CustomizedStruct customizedStruct, PropertyDef prop, bool canBePar)
{
InitializeComponent();
this.Owner = MainWindow.Instance;
this.metaPropertyPanel.Initialize(canBeEdited, agent, customizedStruct, prop, canBePar);
}
示例2: ResetMembers
public override bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method = null, PropertyDef property = null)
{
bool bReset = false;
if (this._frames != null)
{
bReset |= this._frames.ResetMembers(check, agentType, clear, method, property);
}
bReset |= base.ResetMembers(check, agentType, clear, method, property);
return bReset;
}
示例3: Initialize
public void Initialize(bool canBeEdit, AgentType agent, CustomizedStruct customizedStruct, PropertyDef prop, bool canBePar)
{
Debug.Check(agent != null || customizedStruct != null);
_initialized = false;
_isModified = false;
_isNew = (prop == null);
_agent = agent;
_customizedStruct = customizedStruct;
_originalProperty = prop;
setTypes();
if (_isNew)
{
this.Text = canBeEdit ? Resources.AddProperty : Resources.ViewProperty;
if (customizedStruct == null)
_property = new PropertyDef(agent, null, agent.AgentTypeName, "", "", "");
else
_property = new PropertyDef(null, null, customizedStruct.Name, "", "", "");
}
else
{
this.Text = canBeEdit ? Resources.EditProperty : Resources.ViewProperty;
resetProperty(prop, prop.IsPar);
}
this.isStaticCheckBox.Visible = (agent != null);
this.isPublicCheckBox.Visible = !canBeEdit && (agent != null);
this.isConstcheckBox.Visible = (agent != null);
this.customizedCheckBox.Visible = !canBeEdit && !_property.IsInherited;
this.isLocalCheckBox.Checked = customizedStruct == null && _property.IsPar;
this.isLocalCheckBox.Visible = canBePar && customizedStruct == null && !_property.IsMember;
this.nameTextBox.Enabled = canBeEdit;
this.arrayCheckBox.Enabled = canBeEdit || _property.IsChangeableType;
this.typeComboBox.Enabled = canBeEdit || _property.IsChangeableType;
this.isStaticCheckBox.Enabled = canBeEdit;
this.isConstcheckBox.Enabled = canBeEdit;
this.dispTextBox.Enabled = canBeEdit;
this.descTextBox.Enabled = canBeEdit;
_initialized = true;
}
示例4: SwapTwoProperties
public bool SwapTwoProperties(PropertyDef property1, PropertyDef property2) {
if (property1 != null && (property1.IsCustomized || property1.IsPar) &&
property2 != null && (property2.IsCustomized || property2.IsPar) &&
(property1.IsCustomized == property2.IsCustomized || property1.IsPar == property2.IsPar)) {
int index1 = getPropertyIndex(property1);
int index2 = getPropertyIndex(property2);
if (index1 >= 0 && index2 >= 0) {
this._propertyList[index1] = property2;
this._propertyList[index2] = property1;
return true;
}
}
return false;
}
示例5: ParInfo
public ParInfo(PropertyDef other)
{
this.CopyFrom(other);
}
示例6: ResetMembers
public bool ResetMembers(bool check, AgentType agentType, bool clear, PropertyDef property)
{
if (property != null && this._property != null &&
(property.OldName == this._property.Name ||
!property.IsArrayElement && this._property.IsArrayElement &&
(property.OldName + "[]") == this._property.Name))
{
if (!check)
{
if (clear || this._property.ShouldBeCleared(agentType))
{
this._property = null;
}
else
{
bool isArrayElement = this._property.IsArrayElement;
this._property.CopyFrom(property);
if (isArrayElement)
{ this._property.SetArrayElement(property); }
}
}
return true;
}
return false;
}
示例7: VariableDef
public VariableDef(PropertyDef property, string valueType)
{
SetProperty(property, valueType);
}
示例8: SetArrayElement
public void SetArrayElement(PropertyDef arrayProperty)
{
Debug.Check(arrayProperty != null && arrayProperty.Type != null && Plugin.IsArrayType(arrayProperty.Type));
this.IsArrayElement = true;
this.IsAddedAutomatically = true;
this.Type = arrayProperty.Type.GetGenericArguments()[0];
this.Name = arrayProperty.Name + "[]";
this.DisplayName = arrayProperty.DisplayName + "[]";
this.Description = this.DisplayName;
}
示例9: PropertyDef
public PropertyDef(PropertyDef other)
{
this.CopyFrom(other);
}
示例10: addRowControl
private void addRowControl(PropertyDef property) {
this.tableLayoutPanel.RowCount++;
this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
int rowIndex = _rowControls.Count + 1;
RowControl rowControl = new RowControl();
_rowControls.Add(rowControl);
rowControl.Name = property.BasicName;
rowControl.NameLabel = new System.Windows.Forms.Label();
rowControl.NameLabel.Dock = System.Windows.Forms.DockStyle.Fill;
rowControl.NameLabel.Margin = new System.Windows.Forms.Padding(0);
rowControl.NameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
rowControl.NameLabel.Text = property.DisplayName;
this.tableLayoutPanel.Controls.Add(rowControl.NameLabel, 0, rowIndex);
rowControl.TypeLabel = new System.Windows.Forms.Label();
rowControl.TypeLabel.Dock = System.Windows.Forms.DockStyle.Fill;
rowControl.TypeLabel.Margin = new System.Windows.Forms.Padding(0);
rowControl.TypeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
rowControl.TypeLabel.Text = Plugin.GetNativeTypeName(property.Type);
this.tableLayoutPanel.Controls.Add(rowControl.TypeLabel, 1, rowIndex);
rowControl.ValueEditor = createPropertyEditor(property);
rowControl.ValueEditor.Dock = System.Windows.Forms.DockStyle.Fill;
rowControl.ValueEditor.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel.Controls.Add(rowControl.ValueEditor, 2, rowIndex);
}
示例11: GetGeneratedPropertyDefaultValue
public static string GetGeneratedPropertyDefaultValue(PropertyDef prop, string typename)
{
return (prop != null) ? GetGeneratedDefaultValue(prop.Type, typename, prop.DefaultValue) : null;
}
示例12: ResetMembers
public override bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method = null, PropertyDef property = null) {
bool bReset = false;
if (this.Opl != null) {
bReset |= this.Opl.ResetMembers(check, agentType, clear, method, property);
}
if (this.Opr1 != null) {
bReset |= this.Opr1.ResetMembers(check, agentType, clear, method, property);
}
if (this.Opr2 != null) {
bReset |= this.Opr2.ResetMembers(check, agentType, clear, method, property);
}
bReset |= base.ResetMembers(check, agentType, clear, method, property);
if (!check && bReset) {
OnPropertyValueChanged(false);
}
return bReset;
}
示例13: resetProperty
private void resetProperty(PropertyDef prop, bool isPar)
{
if (isPar)
_property = new ParInfo(prop);
else
_property = new PropertyDef(prop);
_property.OldName = prop.Name;
_isArray = Plugin.IsArrayType(_property.Type);
Type type = _isArray ? _property.Type.GetGenericArguments()[0] : _property.Type;
this.nameTextBox.Text = _property.BasicName;
this.arrayCheckBox.Checked = _isArray;
this.typeComboBox.Text = Plugin.GetMemberValueTypeName(type);
this.isStaticCheckBox.Checked = _property.IsStatic;
this.isPublicCheckBox.Checked = _property.IsPublic;
this.isConstcheckBox.Checked = _property.IsReadonly;
this.customizedCheckBox.Checked = _property.IsExportedButAlsoCustomized;
this.dispTextBox.Text = _property.DisplayName;
this.descTextBox.Text = _property.BasicDescription;
resetType(type, false);
}
示例14: GetGeneratedPropertyDefaultValue
public static string GetGeneratedPropertyDefaultValue(PropertyDef prop, string typename)
{
string value = "";
if (prop != null)
{
value = prop.DefaultValue;
if (Plugin.IsStringType(prop.Type))
{
value = "\"" + value + "\"";
}
else if (Plugin.IsBooleanType(prop.Type))
{
value = value.ToLowerInvariant();
}
else if (Plugin.IsEnumType(prop.Type))
{
value = string.Format("{0}.{1}", typename, value);
}
else if (Plugin.IsArrayType(prop.Type))
{
value = "";
}
else if (Plugin.IsCustomClassType(prop.Type))
{
value = "";
}
}
return value;
}
示例15: getPropertyIndex
private int getPropertyIndex(PropertyDef property) {
if (property != null) {
for (int i = 0; i < this._propertyList.Count; ++i) {
if (property == this._propertyList[i])
{ return i; }
}
}
return -1;
}