예제 #1
0
파일: DataHub.cs 프로젝트: lulzzz/openECA
        public void RemoveUDT(UserDefinedType udt)
        {
            UDTCompiler     udtCompiler          = CreateUDTCompiler();
            MappingCompiler mappingInputCompiler = new MappingCompiler(udtCompiler);

            mappingInputCompiler.Scan(s_udimDirectory);
            MappingCompiler mappingOutputCompiler = new MappingCompiler(udtCompiler);

            mappingOutputCompiler.Scan(s_udomDirectory);


            List <DataType> dataTypes = GetEnumeratedReferenceTypes(udt);

            dataTypes.Reverse();

            foreach (DataType type in dataTypes)
            {
                foreach (TypeMapping mapping in mappingInputCompiler.GetMappings((UserDefinedType)type))
                {
                    RemoveInputMapping(mapping);
                }

                foreach (TypeMapping mapping in mappingOutputCompiler.GetMappings((UserDefinedType)type))
                {
                    RemoveOutputMapping(mapping);
                }

                string categoryPath = Path.Combine(s_udtDirectory, type.Category);
                string typePath     = Path.Combine(categoryPath, type.Identifier + ".ecaidl");

                lock (s_udtLock)
                {
                    File.Delete(typePath);

                    if (!Directory.EnumerateFileSystemEntries(categoryPath).Any())
                    {
                        Directory.Delete(categoryPath);
                    }
                }
            }
        }
예제 #2
0
파일: DataHub.cs 프로젝트: lulzzz/openECA
        public List <TypeMapping> GetOutputMappings(UserDefinedType udt)
        {
            MappingCompiler mappingCompiler = CreateOutputMappingCompiler();

            return(mappingCompiler.GetMappings(udt));
        }