/// <summary> /// Update logic /// </summary> public override void update() { CswNbtMetaDataObjectClass SizeOc = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( NbtObjectClass.SizeClass ); // moved to RunBeforeEveryExecutionOfUpdater_01OC //CswNbtMetaDataObjectClassProp UnitCountOcp = _CswNbtSchemaModTrnsctn.createObjectClassProp( new CswNbtWcfMetaDataModel.ObjectClassProp( SizeOc ) //{ // PropName = CswNbtObjClassSize.PropertyName.UnitCount, // FieldType = CswNbtMetaDataFieldType.NbtFieldType.Number, // IsRequired = true, // SetValOnAdd = true, // NumberMinValue = 1, // NumberPrecision = 0 //} ); CswNbtMetaDataNodeType SizeNt = SizeOc.FirstNodeType; if( null != SizeNt ) { CswNbtMetaDataNodeTypeProp UnitCountNtp = SizeNt.getNodeTypePropByObjectClassProp( CswNbtObjClassSize.PropertyName.UnitCount ); UnitCountNtp.DefaultValue.AsNumber.Value = 1; } foreach( CswNbtObjClassSize SizeNode in SizeOc.getNodes( false, false ) ) { SizeNode.UnitCount.Value = 1; SizeNode.postChanges( false ); } }
public override void update() { CswNbtMetaDataObjectClass SizeOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.SizeClass ); foreach( CswNbtMetaDataNodeType SizeNT in SizeOC.getNodeTypes() ) { CswNbtMetaDataNodeTypeProp UPCNTP = SizeNT.getNodeTypePropByObjectClassProp( CswNbtObjClassSize.PropertyName.UPC ); UPCNTP.removeFromAllLayouts(); } CswNbtMetaDataObjectClassProp UPCBarcodeOCP = SizeOC.getObjectClassProp( "UPC Barcode" ); if( null != UPCBarcodeOCP ) { foreach( CswNbtObjClassSize SizeNode in SizeOC.getNodes( false, false, false ) ) { if( null != SizeNode.Node.Properties["UPC Barcode"] ) { SizeNode.UPC.Text = SizeNode.Node.Properties["UPC Barcode"].AsBarcode.Barcode; SizeNode.postChanges(false); } } _CswNbtSchemaModTrnsctn.MetaData.DeleteObjectClassProp( UPCBarcodeOCP, true ); } } // update()