Ejemplo n.º 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()
        public override void update()
        {
            CswNbtMetaDataObjectClass GhsOC = _CswNbtSchemaModTrnsctn.MetaData.getObjectClass( CswEnumNbtObjectClass.GHSClass );
            foreach( CswNbtMetaDataNodeType GhsNT in GhsOC.getNodeTypes() )
            {
                CswNbtMetaDataNodeTypeProp GhsPictogramsNTP = GhsNT.getNodeTypePropByObjectClassProp( CswNbtObjClassGHS.PropertyName.Pictograms );

                CswDelimitedString PictoPaths = new CswDelimitedString( '\n' )
                    {
                        "Images/cispro/ghs/512/rondflam.jpg",
                        "Images/cispro/ghs/512/flamme.jpg",
                        "Images/cispro/ghs/512/explos.jpg",
                        "Images/cispro/ghs/512/skull.jpg",
                        "Images/cispro/ghs/512/acid.jpg",
                        "Images/cispro/ghs/512/bottle.jpg",
                        "Images/cispro/ghs/512/silhouet.jpg",
                        "Images/cispro/ghs/512/pollut.jpg",
                        "Images/cispro/ghs/512/exclam.jpg"
                    };
                GhsPictogramsNTP.ValueOptions = PictoPaths.ToString();

                foreach( CswNbtObjClassGHS GhsNode in GhsNT.getNodes( false, true ) )
                {
                    if( GhsNode.Pictograms.Value.Contains( "/ghs/600/" ) )
                    {
                        GhsNode.Pictograms.Value.Replace( "/ghs/600/", "/ghs/512/" );
                    }
                    else
                    {
                        GhsNode.Pictograms.Value.Replace( "/ghs/", "/ghs/512/" );
                    }
                    GhsNode.postChanges( false );
                }
            } // foreach( CswNbtMetaDataNodeType GhsNT in GhsOC.getNodeTypes() )

        } // update()