예제 #1
0
        public override void update()
        {
            // This fixes what CswUpdateSchema_02G_Case30473 failed to do correctly

            CswNbtMetaDataObjectClass GhsOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.GHSClass );
            foreach( CswNbtMetaDataNodeType GhsNT in GhsOC.getNodeTypes() )
            {
                foreach( CswNbtObjClassGHS GhsNode in GhsNT.getNodes( false, true ) )
                {
                    CswDelimitedString oldVals = GhsNode.Pictograms.Value;
                    CswDelimitedString newVals = new CswDelimitedString( CswNbtNodePropImageList.Delimiter );
                    foreach( string oldVal in oldVals )
                    {
                        if( oldVal.IndexOf( "/ghs/" ) >= 0 )
                        {
                            char testChar = oldVal[( oldVal.IndexOf( "/ghs/" ) + "/ghs/".Length )];
                            string newVal;
                            if( CswTools.IsNumeric( testChar ) )
                            {
                                newVal = oldVal.Replace( "/ghs/600/", "/ghs/512/" );
                            }
                            else
                            {
                                newVal = oldVal.Replace( "/ghs/", "/ghs/512/" );
                            }
                            newVals.Add( newVal );
                        }
                    }
                    GhsNode.Pictograms.Value = newVals;
                    GhsNode.postChanges( false );
                } // foreach( CswNbtObjClassGHS GhsNode in GhsNT.getNodes( false, true ) )
            } // foreach( CswNbtMetaDataNodeType GhsNT in GhsOC.getNodeTypes() )

        } // update()