Esempio n. 1
0
        public Moflon2Parser(String[] args)
        {
            eapFile = new ValueArgument <string>('a', "eap", "eap file");
            xmiFile = new ValueArgument <string>('x', "xmi", "xmi file");
            export  = new SwitchArgument('e', "export", false);
            import  = new SwitchArgument('i', "import", false);
            codegen2compatibility = new SwitchArgument('c', "codegen2", false);
            validate = new SwitchArgument('v', "validate", false);

            eapFile.AllowMultiple = true;
            parser.AdditionalArgumentsSettings.AcceptAdditionalArguments = true;

            parser.Arguments.Add(eapFile);
            parser.Arguments.Add(xmiFile);
            parser.Arguments.Add(export);
            parser.Arguments.Add(import);
            parser.Arguments.Add(codegen2compatibility);
            parser.Arguments.Add(validate);
            try
            {
                parser.ParseCommandLine(args);
            }
            catch (UnknownArgumentException e)
            {
                Console.Out.WriteLine("EXCEPTION:" + e.Message + "#");
            }
            doImport();
            doExport();

            if (validate.Value)
            {
                EA.Repository repository = null;
                String        filename   = eapFile.Value;
                repository = new EA.Repository();
                repository.OpenFile(filename);
                ConsistencyModule cM = new ConsistencyModule();
                cM.initializeRules();

                SQLRepository sqlRep = new SQLRepository(repository, false);

                cM.dispatchFullRulecheck(ref sqlRep, true);
            }
        }
Esempio n. 2
0
 public void EA_OnInitializeUserRules(EA.Repository Repository)
 {
     consistencyModule = new ConsistencyModule();
     consistencyModule.initializeRules();
 }