public void AddUndefinedObjects( ISchemaDefinition src, ISchemaDefinition edustructuresSchema ) { IDictionary srcHash = src.GetAllEnums(); foreach ( string enumKey in srcHash.Keys ) { if ( edustructuresSchema.GetEnum( enumKey ) == null ) { // Exclude YesNo enums EnumDef srcDef = src.GetEnum( enumKey ); if( srcDef.Values.Count < 4 && srcDef.ContainsValue( "Yes") && srcDef.ContainsValue( "No" ) ) { continue; } AddUndefinedEnum( srcHash[enumKey] as EnumDef, edustructuresSchema.Version ); } } srcHash = src.GetAllObjects(); foreach ( string key in srcHash.Keys ) { if ( key.StartsWith( "State" ) || key.StartsWith( "Country" ) ) { continue; } System.Diagnostics.Debug.Assert(key != "LAInfo"); if ( edustructuresSchema.GetObject( key ) == null ) { AddUndefinedObject( srcHash[key] as ObjectDef, edustructuresSchema.Version ); } } saveChanges(); }
public void AddUndefinedObjects(ISchemaDefinition src, ISchemaDefinition edustructuresSchema) { IDictionary srcHash = src.GetAllEnums(); foreach (string enumKey in srcHash.Keys) { if (edustructuresSchema.GetEnum(enumKey) == null) { // Exclude YesNo enums EnumDef srcDef = src.GetEnum(enumKey); if (srcDef.Values.Count < 4 && srcDef.ContainsValue("Yes") && srcDef.ContainsValue("No")) { continue; } AddUndefinedEnum(srcHash[enumKey] as EnumDef, edustructuresSchema.Version); } } srcHash = src.GetAllObjects(); foreach (string key in srcHash.Keys) { if (key.StartsWith("State") || key.StartsWith("Country")) { continue; } System.Diagnostics.Debug.Assert(key != "LAInfo"); if (edustructuresSchema.GetObject(key) == null) { AddUndefinedObject(srcHash[key] as ObjectDef, edustructuresSchema.Version); } } saveChanges(); }