private void DisplayAttributes(TreeNode selectedNode) { if ((selectedNode != null) && (selectedNode.Tag is DEMetaClass)) { this.txtField.Text = selectedNode.Text; this.txtField.Tag = ((DEMetaClass)selectedNode.Tag).Name; ArrayList attris = new ArrayList(ModelContext.MetaModel.GetAllAttributes(((DEMetaClass)selectedNode.Tag).Name)); FixedAttribute fixedAttr = new FixedAttribute("OID", "主对象唯一标识", "M", PLMDataType.Guid); GenericAttribute attribute2 = GenericAttribute.CreateAttribute(fixedAttr); attris.Add(attribute2); string tag = this.ultraEditor.Tag as string; GenericAttribute[] c = new GenericAttribute[0]; if (tag != null) { c = ModelContext.MetaModel.GetRelationGenericAttributes(tag); for (int i = 0; i < c.Length; i++) { c[i].Label = "(关联)" + c[i].Label; } attris.AddRange(c); } this.FilterAttributes(attris, ((DEMetaClass)selectedNode.Tag).Name); if ((attris != null) && (attris.Count > 0)) { this.cobAttrList.DataSource = attris; this.cobAttrList.ValueMember = "Name"; this.cobAttrList.DisplayMember = "Label"; } } }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (style == null) { style = new GUIStyle((GUIStyle)"TextField"); } FixedAttribute range = attribute as FixedAttribute; EditorGUI.BeginChangeCheck(); property.intValue = EditorGUI.IntField(position, property.intValue, style); if (EditorGUI.EndChangeCheck()) { property.serializedObject.ApplyModifiedProperties(); } }
private static NumberFormat GetNumberFormat(FieldInfo field) { FixedAttribute attr = field.GetCustomAttribute <FixedAttribute>(true); return(attr == null ? NumberFormat.Variant : NumberFormat.Fixed); }