private void _updateAvailableWorkUnits() { //Case 30817 (Case 30843: moved to here from onBeforeCreate) if (CswTools.IsPrimaryKey(CurrentWorkUnitId) && false == AvailableWorkUnits.CheckValue(CurrentWorkUnitId.ToString())) { AvailableWorkUnits.AddValue(CurrentWorkUnitId.ToString()); CurrentWorkUnitProperty.RelatedNodeId = CurrentWorkUnitId; CurrentWorkUnitProperty.SyncGestalt(); } CswNbtView View = _CswNbtResources.ViewSelect.restoreView(CurrentWorkUnitProperty.NodeTypeProp.ViewId); View.Clear(); View.SetVisibility(CswEnumNbtViewVisibility.Property, null, null); CswNbtMetaDataObjectClass WorkUnitOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.WorkUnitClass); CswNbtViewRelationship WorkUnitParent = View.AddViewRelationship(WorkUnitOC, false); foreach (string WorkUnitNodeId in AvailableWorkUnits.Value) { CswPrimaryKey pk = CswConvert.ToPrimaryKey(WorkUnitNodeId); WorkUnitParent.NodeIdsToFilterIn.Add(pk); } CurrentWorkUnitProperty.OverrideView(View); }
public void OnAvailableWorkUnitsChange(CswNbtNodeProp Prop, bool Creating) { _updateAvailableWorkUnits(); if (null == CurrentWorkUnitId || false == AvailableWorkUnits.CheckValue(CurrentWorkUnitId.ToString())) { CswPrimaryKey pk = CswConvert.ToPrimaryKey(AvailableWorkUnits.Value[0]); //we're always guarenteed there's at least one CurrentWorkUnitProperty.RelatedNodeId = pk; CurrentWorkUnitProperty.SyncGestalt(); } }