protected override void afterPromoteNodeLogic() { // ------------------------------------------------------------ // This logic from makeNewNodeType in CswNbtMetaData.cs // ------------------------------------------------------------ if (CswTools.IsPrimaryKey(RelationalId)) { Int32 NodeTypeId = RelationalId.PrimaryKey; //CswTableUpdate NodeTypesUpdate = _CswNbtResources.makeCswTableUpdate( "DesignNodeType_afterCreateNode_NodeTypesUpdate", "nodetypes" ); //DataTable NodeTypesTable = NodeTypesUpdate.getTable( "nodetypeid", NodeTypeId ); //if( NodeTypesTable.Rows.Count > 0 ) //{ // Set values not controlled by the node //DataRow NodeTypesRow = NodeTypesTable.Rows[0]; if (null != RelationalNodeType) { DataRow NodeTypesRow = RelationalNodeType._DataRow; NodeTypesRow["versionno"] = "1"; NodeTypesRow["tablename"] = "nodes"; NodeTypesRow["nodecount"] = 0; NodeTypesRow["firstversionid"] = NodeTypeId.ToString(); _CswNbtResources.MetaData._CswNbtMetaDataResources.NodeTypeTableUpdate.update(NodeTypesRow.Table); //CswNbtMetaDataNodeType NewNodeType = RelationalNodeType; if (false == InternalCreate) { // Now can create nodetype_props and tabset records //CswTableUpdate NodeTypePropTableUpdate = _CswNbtResources.makeCswTableUpdate( "DesignNodeType_afterCreateNode_NodeTypePropUpdate", "nodetypes" ); //DataTable NodeTypeProps = NodeTypePropTableUpdate.getTable( "nodetypeid", NodeTypeId ); // Make an initial tab //CswNbtMetaDataObjectClass DesignNodeTypeOC = _CswNbtResources.MetaData.getObjectClass( CswEnumNbtObjectClass.DesignNodeTypeClass ); CswNbtMetaDataObjectClass DesignNodeTypeTabOC = _CswNbtResources.MetaData.getObjectClass(CswEnumNbtObjectClass.DesignNodeTypeTabClass); //CswNbtMetaDataObjectClass DesignNodeTypePropOC = _CswNbtResources.MetaData.getObjectClass( CswEnumNbtObjectClass.DesignNodeTypePropClass ); //CswNbtMetaDataNodeType DesignNodeTypeNT = DesignNodeTypeOC.FirstNodeType; CswNbtMetaDataNodeType DesignNodeTypeTabNT = DesignNodeTypeTabOC.FirstNodeType; //CswNbtMetaDataNodeType DesignNodeTypePropNT = DesignNodeTypePropOC.FirstNodeType; if (null != DesignNodeTypeTabNT) { _CswNbtResources.Nodes.makeNodeFromNodeTypeId(DesignNodeTypeTabNT.NodeTypeId, delegate(CswNbtNode NewNode) { CswNbtObjClassDesignNodeTypeTab IdentityTab = NewNode; IdentityTab.NodeTypeValue.RelatedNodeId = this.NodeId; IdentityTab.TabName.Text = CswNbtMetaData.IdentityTabName; IdentityTab.Order.Value = 0; //IdentityTab.ServerManaged.Checked = CswEnumTristate.True; //IdentityTab.postChanges( false ); }); _CswNbtResources.Nodes.makeNodeFromNodeTypeId(DesignNodeTypeTabNT.NodeTypeId, delegate(CswNbtNode NewNode) { CswNbtObjClassDesignNodeTypeTab FirstTab = NewNode; FirstTab.NodeTypeValue.RelatedNodeId = this.NodeId; FirstTab.TabName.Text = NodeTypeName.Text; FirstTab.Order.Value = 1; // FirstTab.postChanges( false ); }); } // if( null != DesignNodeTypeTabNT ) // Make initial props _setPropertyValuesFromObjectClass(); _requiresSync = false; } // if( false == InternalCreate ) //if( OnMakeNewNodeType != null ) // OnMakeNewNodeType( NewNodeType, false ); //refreshAll(); //will need to refresh auto-views //_RefreshViewForNodetypeId.Add( NodeTypeId ); } // if( null != RelationalNodeType ) // Give the current user's role full permissions to the new nodetype CswEnumNbtNodeTypePermission[] AllPerms = new CswEnumNbtNodeTypePermission[] { CswEnumNbtNodeTypePermission.Delete, CswEnumNbtNodeTypePermission.Create, CswEnumNbtNodeTypePermission.Edit, CswEnumNbtNodeTypePermission.View }; if (null != _CswNbtResources.CurrentNbtUser.RoleId) { CswNbtNode RoleNode = _CswNbtResources.Nodes[_CswNbtResources.CurrentNbtUser.RoleId]; CswNbtObjClassRole RoleNodeAsRole = (CswNbtObjClassRole)RoleNode; // case 23185 - reset permission options RoleNodeAsRole.triggerAfterPopulateProps(); _CswNbtResources.Permit.set(AllPerms, RelationalId.PrimaryKey, RoleNodeAsRole, true); }//if we have a current user else if (_CswNbtResources.CurrentNbtUser is CswNbtSystemUser) { // Grant permission to Administrator, unless it's a Design nodetype if (RelationalNodeType.getObjectClass().ObjectClass != CswEnumNbtObjectClass.DesignNodeTypeClass && RelationalNodeType.getObjectClass().ObjectClass != CswEnumNbtObjectClass.DesignNodeTypeTabClass && RelationalNodeType.getObjectClass().ObjectClass != CswEnumNbtObjectClass.DesignNodeTypePropClass && RelationalNodeType.getObjectClass().ObjectClass != CswEnumNbtObjectClass.DesignSequenceClass) { CswNbtObjClassRole RoleNode = _CswNbtResources.Nodes.makeRoleNodeFromRoleName("Administrator"); if (RoleNode != null) { _CswNbtResources.Permit.set(AllPerms, RelationalNodeType, RoleNode, true); } } // Grant permission to chemsw_admin CswNbtObjClassRole RoleNode2 = _CswNbtResources.Nodes.makeRoleNodeFromRoleName(CswNbtObjClassRole.ChemSWAdminRoleName); if (RoleNode2 != null) { _CswNbtResources.Permit.set(AllPerms, RelationalNodeType, RoleNode2, true); } } if (ObjectClassPropertyValue.ObjectClass == CswEnumNbtObjectClass.InspectionDesignClass) { _OnMakeNewInspectionDesignNodeType(RelationalNodeType); } } // if( CswTools.IsPrimaryKey( RelationalId ) ) } // afterPromoteNode()
public override CswNbtNode CopyNode(bool IsNodeTemp = false, Action <CswNbtNode> OnCopy = null) { // Copy NodeType string NewNodeTypeName = "Copy Of " + NodeTypeName.Text; Int32 CopyInt = 1; while (null != _CswNbtResources.MetaData.getNodeType(NewNodeTypeName)) { CopyInt++; NewNodeTypeName = "Copy " + CopyInt.ToString() + " Of " + NodeTypeName.Text; } CswNbtObjClassDesignNodeType NodeTypeCopy = base.CopyNodeImpl(IsNodeTemp, delegate(CswNbtNode NewNode) { ((CswNbtObjClassDesignNodeType)NewNode).InternalCreate = true; ((CswNbtObjClassDesignNodeType)NewNode).NodeTypeName.Text = NewNodeTypeName; if (null != OnCopy) { OnCopy(NewNode); } }); // Copy Tabs Dictionary <Int32, CswNbtObjClassDesignNodeTypeTab> TabMap = new Dictionary <Int32, CswNbtObjClassDesignNodeTypeTab>(); foreach (CswNbtObjClassDesignNodeTypeTab TabNode in getTabNodes()) { CswNbtObjClassDesignNodeTypeTab TabCopy = TabNode.CopyNode(IsNodeTemp, delegate(CswNbtNode CopiedNode) { ((CswNbtObjClassDesignNodeTypeTab)CopiedNode).NodeTypeValue.RelatedNodeId = NodeTypeCopy.NodeId; ((CswNbtObjClassDesignNodeTypeTab)CopiedNode).TabName.Text = TabNode.TabName.Text; }); TabMap.Add(TabNode.RelationalId.PrimaryKey, TabCopy); } // case 31518 - props won't be able to see the tab if we don't do this _CswNbtResources.MetaData.refreshAll(); // Copy Props Collection <CswNbtObjClassDesignNodeTypeProp> PropNodes = getPropNodes(); Dictionary <Int32, CswNbtObjClassDesignNodeTypeProp> PropMap = new Dictionary <Int32, CswNbtObjClassDesignNodeTypeProp>(); foreach (CswNbtObjClassDesignNodeTypeProp PropNode in PropNodes) { CswNbtObjClassDesignNodeTypeProp PropCopy = PropNode.CopyNode(IsNodeTemp, delegate(CswNbtNode CopiedNode) { ((CswNbtObjClassDesignNodeTypeProp)CopiedNode).NodeTypeValue.RelatedNodeId = NodeTypeCopy.NodeId; ((CswNbtObjClassDesignNodeTypeProp)CopiedNode).PropName.Text = PropNode.PropName.Text; }); PropMap.Add(PropNode.RelationalId.PrimaryKey, PropCopy); // Fix layout if (PropCopy.PropName.Text.Equals(CswNbtObjClass.PropertyName.Save)) { foreach (CswNbtObjClassDesignNodeTypeTab NewTab in TabMap.Values) { //Case 29181 - Save prop on all tabs except identity if (NewTab.RelationalId.PrimaryKey != NodeTypeCopy.RelationalNodeType.getIdentityTab().TabId) { _CswNbtResources.MetaData.NodeTypeLayout.updatePropLayout(CswEnumNbtLayoutType.Edit, NodeTypeCopy.RelationalId.PrimaryKey, PropCopy.RelationalNodeTypeProp, false, NewTab.RelationalId.PrimaryKey, Int32.MaxValue, 1); } } } else { foreach (CswEnumNbtLayoutType LayoutType in CswEnumNbtLayoutType._All) { Dictionary <Int32, CswNbtMetaDataNodeTypeLayoutMgr.NodeTypeLayout> OriginalLayouts = _CswNbtResources.MetaData.NodeTypeLayout.getLayout(LayoutType, PropNode.RelationalNodeTypeProp, null); foreach (CswNbtMetaDataNodeTypeLayoutMgr.NodeTypeLayout OriginalLayout in OriginalLayouts.Values) { if (OriginalLayout != null) { Int32 NewTabId = Int32.MinValue; if (LayoutType == CswEnumNbtLayoutType.Edit) { NewTabId = TabMap[OriginalLayout.TabId].RelationalId.PrimaryKey; } _CswNbtResources.MetaData.NodeTypeLayout.updatePropLayout(LayoutType, NodeTypeCopy.RelationalId.PrimaryKey, PropCopy.RelationalNodeTypeProp, true, NewTabId, OriginalLayout.DisplayRow, OriginalLayout.DisplayColumn); } } } // foreach( CswEnumNbtLayoutType LayoutType in CswEnumNbtLayoutType._All ) } } // foreach( CswNbtObjClassDesignNodeTypeProp PropNode in getPropNodes() ) // Fix Conditional Props (case 22328) foreach (CswNbtObjClassDesignNodeTypeProp PropNode in PropNodes) { if (CswTools.IsPrimaryKey(PropNode.DisplayConditionProperty.RelatedNodeId)) { CswNbtObjClassDesignNodeTypeProp PropCopy = PropMap[PropNode.RelationalId.PrimaryKey]; CswNbtObjClassDesignNodeTypeProp DisplayConditionProp = PropNodes.FirstOrDefault(p => p.NodeId == PropNode.DisplayConditionProperty.RelatedNodeId); if (null != DisplayConditionProp) { CswNbtObjClassDesignNodeTypeProp DisplayConditionPropCopy = PropMap[DisplayConditionProp.RelationalId.PrimaryKey]; PropCopy.DisplayConditionProperty.RelatedNodeId = DisplayConditionPropCopy.NodeId; } } } // Fix the name template, now that properties are in place NodeTypeCopy.postChanges(true); //if( OnCopyNodeType != null ) // OnCopyNodeType( OldNodeType, NewNodeType ); return(NodeTypeCopy.Node); } // CopyNode()
/// <summary> /// Create an ObjClass instance for given ObjectClass and Node /// </summary> public static CswNbtObjClass makeObjClass(CswNbtResources CswNbtResources, CswNbtMetaDataObjectClass ObjectClass, CswNbtNode Node = null) { CswNbtObjClass ReturnVal = null; switch (ObjectClass.ObjectClass) { case CswEnumNbtObjectClass.BalanceClass: ReturnVal = new CswNbtObjClassBalance(CswNbtResources, Node); break; case CswEnumNbtObjectClass.BalanceConfigurationClass: ReturnVal = new CswNbtObjClassBalanceConfiguration(CswNbtResources, Node); break; case CswEnumNbtObjectClass.BatchOpClass: ReturnVal = new CswNbtObjClassBatchOp(CswNbtResources, Node); break; case CswEnumNbtObjectClass.BiologicalClass: ReturnVal = new CswNbtObjClassBiological(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CertDefCharacteristicLimitClass: ReturnVal = new CswNbtObjClassCertDefCharacteristicLimit(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CertDefSpecClass: ReturnVal = new CswNbtObjClassCertDefSpec(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CertificateDefinitionClass: ReturnVal = new CswNbtObjClassCertificateDefinition(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CertDefConditionClass: ReturnVal = new CswNbtObjClassCertDefCondition(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CertDefSpecLevelClass: ReturnVal = new CswNbtObjClassCertDefSpecLevel(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CofADocumentClass: ReturnVal = new CswNbtObjClassCofADocument(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CofAMethodClass: ReturnVal = new CswNbtObjClassCofAMethod(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CofAMethodTemplateClass: ReturnVal = new CswNbtObjClassCofAMethodTemplate(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ContainerClass: ReturnVal = new CswNbtObjClassContainer(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ContainerDispenseTransactionClass: ReturnVal = new CswNbtObjClassContainerDispenseTransaction(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ContainerGroupClass: ReturnVal = new CswNbtObjClassContainerGroup(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ContainerLocationClass: ReturnVal = new CswNbtObjClassContainerLocation(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ControlZoneClass: ReturnVal = new CswNbtObjClassControlZone(CswNbtResources, Node); break; case CswEnumNbtObjectClass.CustomerClass: ReturnVal = new CswNbtObjClassCustomer(CswNbtResources, Node); break; case CswEnumNbtObjectClass.DepartmentClass: ReturnVal = new CswNbtObjClassDepartment(CswNbtResources, Node); break; case CswEnumNbtObjectClass.DesignNodeTypeClass: ReturnVal = new CswNbtObjClassDesignNodeType(CswNbtResources, Node); break; case CswEnumNbtObjectClass.DesignNodeTypePropClass: ReturnVal = new CswNbtObjClassDesignNodeTypeProp(CswNbtResources, Node); break; case CswEnumNbtObjectClass.DesignNodeTypeTabClass: ReturnVal = new CswNbtObjClassDesignNodeTypeTab(CswNbtResources, Node); break; case CswEnumNbtObjectClass.DesignSequenceClass: ReturnVal = new CswNbtObjClassDesignSequence(CswNbtResources, Node); break; case CswEnumNbtObjectClass.DocumentClass: ReturnVal = new CswNbtObjClassDocument(CswNbtResources, Node); break; case CswEnumNbtObjectClass.DSDPhraseClass: ReturnVal = new CswNbtObjClassDSDPhrase(CswNbtResources, Node); break; case CswEnumNbtObjectClass.EnterprisePartClass: ReturnVal = new CswNbtObjClassEnterprisePart(CswNbtResources, Node); break; case CswEnumNbtObjectClass.EquipmentAssemblyClass: ReturnVal = new CswNbtObjClassEquipmentAssembly(CswNbtResources, Node); break; case CswEnumNbtObjectClass.EquipmentClass: ReturnVal = new CswNbtObjClassEquipment(CswNbtResources, Node); break; case CswEnumNbtObjectClass.EquipmentTypeClass: ReturnVal = new CswNbtObjClassEquipmentType(CswNbtResources, Node); break; case CswEnumNbtObjectClass.FeedbackClass: ReturnVal = new CswNbtObjClassFeedback(CswNbtResources, Node); break; case CswEnumNbtObjectClass.FireClassExemptAmountClass: ReturnVal = new CswNbtObjClassFireClassExemptAmount(CswNbtResources, Node); break; case CswEnumNbtObjectClass.FireClassExemptAmountSetClass: ReturnVal = new CswNbtObjClassFireClassExemptAmountSet(CswNbtResources, Node); break; case CswEnumNbtObjectClass.GenericClass: ReturnVal = new CswNbtObjClassGeneric(CswNbtResources, Node); break; case CswEnumNbtObjectClass.GHSClass: ReturnVal = new CswNbtObjClassGHS(CswNbtResources, Node); break; case CswEnumNbtObjectClass.GHSClassificationClass: ReturnVal = new CswNbtObjClassGHSClassification(CswNbtResources, Node); break; case CswEnumNbtObjectClass.GHSPhraseClass: ReturnVal = new CswNbtObjClassGHSPhrase(CswNbtResources, Node); break; case CswEnumNbtObjectClass.GHSSignalWordClass: ReturnVal = new CswNbtObjClassGHSSignalWord(CswNbtResources, Node); break; case CswEnumNbtObjectClass.InspectionDesignClass: ReturnVal = new CswNbtObjClassInspectionDesign(CswNbtResources, Node); break; case CswEnumNbtObjectClass.InspectionRouteClass: ReturnVal = new CswNbtObjClassInspectionRoute(CswNbtResources, Node); break; case CswEnumNbtObjectClass.InspectionTargetClass: ReturnVal = new CswNbtObjClassInspectionTarget(CswNbtResources, Node); break; case CswEnumNbtObjectClass.InspectionTargetGroupClass: ReturnVal = new CswNbtObjClassInspectionTargetGroup(CswNbtResources, Node); break; case CswEnumNbtObjectClass.InventoryGroupClass: ReturnVal = new CswNbtObjClassInventoryGroup(CswNbtResources, Node); break; case CswEnumNbtObjectClass.InventoryGroupPermissionClass: ReturnVal = new CswNbtObjClassInventoryGroupPermission(CswNbtResources, Node); break; case CswEnumNbtObjectClass.InventoryLevelClass: ReturnVal = new CswNbtObjClassInventoryLevel(CswNbtResources, Node); break; case CswEnumNbtObjectClass.JurisdictionClass: ReturnVal = new CswNbtObjClassJurisdiction(CswNbtResources, Node); break; case CswEnumNbtObjectClass.Level: ReturnVal = new CswNbtObjClassLevel(CswNbtResources, Node); break; case CswEnumNbtObjectClass.LocationClass: ReturnVal = new CswNbtObjClassLocation(CswNbtResources, Node); break; case CswEnumNbtObjectClass.LQNoClass: ReturnVal = new CswNbtObjClassLQNo(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ManufacturerClass: ReturnVal = new CswNbtObjClassManufacturer(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ManufacturerEquivalentPartClass: ReturnVal = new CswNbtObjClassManufacturerEquivalentPart(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ChemicalClass: ReturnVal = new CswNbtObjClassChemical(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MaterialComponentClass: ReturnVal = new CswNbtObjClassMaterialComponent(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MaterialSynonymClass: ReturnVal = new CswNbtObjClassMaterialSynonym(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MailReportClass: ReturnVal = new CswNbtObjClassMailReport(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MailReportGroupClass: ReturnVal = new CswNbtObjClassMailReportGroup(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MailReportGroupPermissionClass: ReturnVal = new CswNbtObjClassMailReportGroupPermission(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MethodClass: ReturnVal = new CswNbtObjClassMethod(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MethodCharacteristicClass: ReturnVal = new CswNbtObjClassMethodCharacteristic(CswNbtResources, Node); break; case CswEnumNbtObjectClass.MethodConditionClass: ReturnVal = new CswNbtObjClassMethodCondition(CswNbtResources, Node); break; case CswEnumNbtObjectClass.NonChemicalClass: ReturnVal = new CswNbtObjClassNonChemical(CswNbtResources, Node); break; case CswEnumNbtObjectClass.PrinterClass: ReturnVal = new CswNbtObjClassPrinter(CswNbtResources, Node); break; case CswEnumNbtObjectClass.PrintJobClass: ReturnVal = new CswNbtObjClassPrintJob(CswNbtResources, Node); break; case CswEnumNbtObjectClass.PrintLabelClass: ReturnVal = new CswNbtObjClassPrintLabel(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ProblemClass: ReturnVal = new CswNbtObjClassProblem(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ReceiptLotClass: ReturnVal = new CswNbtObjClassReceiptLot(CswNbtResources, Node); break; case CswEnumNbtObjectClass.RegulatoryListClass: ReturnVal = new CswNbtObjClassRegulatoryList(CswNbtResources, Node); break; case CswEnumNbtObjectClass.RegulatoryListCasNoClass: ReturnVal = new CswNbtObjClassRegulatoryListCasNo(CswNbtResources, Node); break; case CswEnumNbtObjectClass.RegulatoryListMemberClass: ReturnVal = new CswNbtObjClassRegulatoryListMember(CswNbtResources, Node); break; case CswEnumNbtObjectClass.RegulatoryListListCodeClass: ReturnVal = new CswNbtObjClassRegulatoryListListCode(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ReportClass: ReturnVal = new CswNbtObjClassReport(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ReportGroupClass: ReturnVal = new CswNbtObjClassReportGroup(CswNbtResources, Node); break; case CswEnumNbtObjectClass.ReportGroupPermissionClass: ReturnVal = new CswNbtObjClassReportGroupPermission(CswNbtResources, Node); break; case CswEnumNbtObjectClass.RequestClass: ReturnVal = new CswNbtObjClassRequest(CswNbtResources, Node); break; case CswEnumNbtObjectClass.RequestItemClass: ReturnVal = new CswNbtObjClassRequestItem(CswNbtResources, Node); break; case CswEnumNbtObjectClass.RoleClass: ReturnVal = new CswNbtObjClassRole(CswNbtResources, Node); break; case CswEnumNbtObjectClass.SDSDocumentClass: ReturnVal = new CswNbtObjClassSDSDocument(CswNbtResources, Node); break; case CswEnumNbtObjectClass.TestingLabClass: ReturnVal = new CswNbtObjClassTestingLab(CswNbtResources, Node); break; case CswEnumNbtObjectClass.GeneratorClass: ReturnVal = new CswNbtObjClassGenerator(CswNbtResources, Node); break; case CswEnumNbtObjectClass.SizeClass: ReturnVal = new CswNbtObjClassSize(CswNbtResources, Node); break; case CswEnumNbtObjectClass.TaskClass: ReturnVal = new CswNbtObjClassTask(CswNbtResources, Node); break; case CswEnumNbtObjectClass.TestingLabUserAssignmentClass: ReturnVal = new CswNbtObjClassTestingLabUserAssignment(CswNbtResources, Node); break; case CswEnumNbtObjectClass.TestingLabMethodAssignmentClass: ReturnVal = new CswNbtObjClassTestingLabMethodAssignment(CswNbtResources, Node); break; case CswEnumNbtObjectClass.UnitOfMeasureClass: ReturnVal = new CswNbtObjClassUnitOfMeasure(CswNbtResources, Node); break; case CswEnumNbtObjectClass.UserClass: ReturnVal = new CswNbtObjClassUser(CswNbtResources, Node); break; case CswEnumNbtObjectClass.VendorClass: ReturnVal = new CswNbtObjClassVendor(CswNbtResources, Node); break; case CswEnumNbtObjectClass.WorkUnitClass: ReturnVal = new CswNbtObjClassWorkUnit(CswNbtResources, Node); break; default: //ReturnVal = new CswNbtObjClassDefault( CswNbtResources, _CswNbtNode ); throw (new CswDniException("There is no NbtObjClass derivative for object class " + ObjectClass.ObjectClass.ToString())); }//switch return(ReturnVal); } //makeObjClass()