当前位置: 首页>>代码示例>>C#>>正文


C# Design.PropertyDef类代码示例

本文整理汇总了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);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:8,代码来源:MetaPropertyDialog.cs

示例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;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:13,代码来源:WaitFramesState.cs

示例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;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:45,代码来源:MetaPropertyPanel.cs

示例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;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:17,代码来源:Agent.cs

示例5: ParInfo

 public ParInfo(PropertyDef other)
 {
     this.CopyFrom(other);
 }
开发者ID:Just4F,项目名称:behaviac,代码行数:4,代码来源:DataType.cs

示例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;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:30,代码来源:DataType.cs

示例7: VariableDef

 public VariableDef(PropertyDef property, string valueType)
 {
     SetProperty(property, valueType);
 }
开发者ID:Just4F,项目名称:behaviac,代码行数:4,代码来源:DataType.cs

示例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;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:11,代码来源:DataType.cs

示例9: PropertyDef

 public PropertyDef(PropertyDef other)
 {
     this.CopyFrom(other);
 }
开发者ID:Just4F,项目名称:behaviac,代码行数:4,代码来源:DataType.cs

示例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);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:29,代码来源:ParametersPanel.cs

示例11: GetGeneratedPropertyDefaultValue

 public static string GetGeneratedPropertyDefaultValue(PropertyDef prop, string typename)
 {
     return (prop != null) ? GetGeneratedDefaultValue(prop.Type, typename, prop.DefaultValue) : null;
 }
开发者ID:675492062,项目名称:behaviac,代码行数:4,代码来源:DataCppExporter.cs

示例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;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:23,代码来源:AttachAction.cs

示例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);
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:23,代码来源:MetaPropertyPanel.cs

示例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;
        }
开发者ID:pjkui,项目名称:behaviac,代码行数:32,代码来源:DataCsExporter.cs

示例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;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:10,代码来源:Agent.cs


注:本文中的Behaviac.Design.PropertyDef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。