예제 #1
0
        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();
        }
예제 #2
0
        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();
        }
예제 #3
0
        public void Compare(ISchemaDefinition officialSpec,
                            ISchemaDefinition unofficialSpec,
                            ICompareOutput output,
                            bool detailedCheck)
        {
            if (officialSpec.Version != unofficialSpec.Version)
            {
                output.ComparisonFailed
                    (officialSpec.Name, "SifVersion", "ToString", officialSpec.Version.ToString(),
                    unofficialSpec.Name, unofficialSpec.Version.ToString(), "");
            }

            CompareObjectDictionary
                (officialSpec.GetAllObjects(), officialSpec.Name, unofficialSpec.GetAllObjects(),
                unofficialSpec.Name, output, detailedCheck);
            // Only compare enums that are defined in the official spec, but not in the unofficial spec

            // TODO: Provide warnings for undocumented members

            CompareEnumDictionary
                (officialSpec.GetAllEnums(), officialSpec.Name, unofficialSpec.GetAllEnums(),
                unofficialSpec.Name, output);
        }