} // setObjectClassPropListOptions() private string _getOwnerName(CswNbtViewProperty ViewProperty) { string ret = string.Empty; CswNbtViewRelationship parent = (CswNbtViewRelationship)ViewProperty.Parent; CswEnumNbtViewRelatedIdType ownerType = parent.getOwnerType(); if (ownerType == CswEnumNbtViewRelatedIdType.NodeTypeId) { CswNbtMetaDataNodeType ntOwner = parent.getNodeTypeOwner(); ret = ntOwner.NodeTypeName; } else if (ownerType == CswEnumNbtViewRelatedIdType.ObjectClassId) { CswNbtMetaDataObjectClass ocOwner = parent.getObjClassOwner(); ret = ocOwner.ObjectClass.ToString(); } else { CswNbtMetaDataPropertySet psOwner = parent.getPropSetOwner(); ret = psOwner.Name; } return(ret); }
private string _getRelationshipOwnerName(CswNbtViewRelationship Relationship) { string ret = string.Empty; if (Relationship.getOwnerType() == CswEnumNbtViewRelatedIdType.NodeTypeId) { ret = Relationship.getNodeTypeOwner().NodeTypeName; } else if (Relationship.getOwnerType() == CswEnumNbtViewRelatedIdType.ObjectClassId) { ret = Relationship.getObjClassOwner().ObjectClassName; } else { ret = Relationship.getPropSetOwner().Name; } return(ret); }
} // _toggleConstituentProps() public override void addDefaultViewFilters( CswNbtViewRelationship ParentRelationship ) { // Not IsConstituent ICswNbtMetaDataProp IsConstituentProp = null; // Exclude Materials that have Obsolete == true ICswNbtMetaDataProp ObsoleteProp = null; CswNbtMetaDataPropertySet materialPs = _CswNbtResources.MetaData.getPropertySet( CswEnumNbtPropertySetName.MaterialSet ); CswNbtMetaDataObjectClass firstMaterialOc = materialPs.getObjectClasses().FirstOrDefault(); // Case 30136 - don't add this filter if the ownertype is nodetype if( ParentRelationship.getOwnerType() == CswEnumNbtViewRelatedIdType.ObjectClassId ) { CswNbtMetaDataObjectClass ObjClass = ParentRelationship.getObjClassOwner(); IsConstituentProp = ObjClass.getObjectClassProp( PropertyName.IsConstituent ); } else if( ParentRelationship.getOwnerType() == CswEnumNbtViewRelatedIdType.PropertySetId ) { //Bug - We're adding the Chemical IsConstituent property here, but for NTPs treeloader works by PropName. Not ideal, but works unless the propname changes IsConstituentProp = firstMaterialOc.getObjectClassProp( PropertyName.IsConstituent ).getNodeTypeProps().FirstOrDefault(); } if( null != IsConstituentProp ) { CswNbtViewProperty viewProp1 = ParentRelationship.View.AddViewProperty( ParentRelationship, IsConstituentProp ); viewProp1.ShowInGrid = false; ParentRelationship.View.AddViewPropertyFilter( viewProp1, FilterMode : CswEnumNbtFilterMode.NotEquals, Value : CswEnumTristate.True ); } ObsoleteProp = firstMaterialOc.getObjectClassProp( PropertyName.Obsolete ); if( null != ObsoleteProp ) { CswNbtViewProperty viewProp2 = ParentRelationship.View.AddViewProperty( ParentRelationship, ObsoleteProp ); viewProp2.ShowInGrid = false; ParentRelationship.View.AddViewPropertyFilter( viewProp2, FilterMode : CswEnumNbtFilterMode.NotEquals, Value : CswEnumTristate.True, ShowAtRuntime : true ); } onPropertySetAddDefaultViewFilters( ParentRelationship ); }