コード例 #1
0
        private void ExtractFromDriverDirectory_(
            IModelDirectory <BmdModelFileBundle> node,
            IFileHierarchyDirectory directory)
        {
            var bmdFiles = directory.FilesWithExtension(".bmd")
                           .ToArray();
            var bcxFiles = directory.FilesWithExtensions(".bca", ".bck")
                           .ToArray();

            var driverBmdFiles = bmdFiles
                                 .Where(file => file.Name.StartsWith("driver"))
                                 .ToArray();
            var driverBcxFiles =
                bcxFiles.Where(file => file.Name.StartsWith("b_") ||
                               file.Name.StartsWith("c_") ||
                               file.Name.StartsWith("all"))
                .ToArray();

            this.ExtractModels_(node,
                                driverBmdFiles,
                                driverBcxFiles);

            var otherBmdFiles = bmdFiles.Where(file => !driverBmdFiles.Contains(file))
                                .ToArray();

            if (otherBmdFiles.Length > 0)
            {
                var otherBcxFiles =
                    bcxFiles.Where(file => !driverBcxFiles.Contains(file))
                    .ToArray();
                this.ExtractModels_(node,
                                    otherBmdFiles,
                                    otherBcxFiles);
            }
        }
コード例 #2
0
        private void ExtractModelsInDirectoryAutomatically_(
            IModelDirectory <BmdModelFileBundle> parentNode,
            IFileHierarchyDirectory directory)
        {
            var bmdFiles = directory.FilesWithExtension(".bmd").ToArray();

            if (bmdFiles.Length > 0)
            {
                var bcxFiles = directory.FilesWithExtensions(".bca", ".bck")
                               .ToList();
                var btiFiles = directory.FilesWithExtension(".bti").ToList();
                this.ExtractModels_(parentNode, bmdFiles, bcxFiles, btiFiles);
            }
        }
コード例 #3
0
        private void ExtractFromSeparateDriverDirectories_(
            IModelDirectory <BmdModelFileBundle> node,
            IFileHierarchyDirectory directory,
            IFileHierarchyDirectory common)
        {
            Asserts.Nonnull(common);

            var bmdFiles = directory.FilesWithExtension(".bmd")
                           .ToArray();
            var commonBcxFiles = common.FilesWithExtensions(".bca", ".bck")
                                 .ToArray();
            var localBcxFiles = directory.FilesWithExtensions(".bca", ".bck")
                                .ToArray();

            this.ExtractModels_(node,
                                bmdFiles,
                                commonBcxFiles.Concat(localBcxFiles).ToArray());
        }
コード例 #4
0
        private void ExtractFromSeparateDirectories_(
            IModelDirectory <BmdModelFileBundle> node,
            IFileHierarchyDirectory directory,
            IFileHierarchyDirectory common)
        {
            Asserts.Nonnull(common);

            var bmdFiles = directory.FilesWithExtension(".bmd")
                           .ToArray();
            var commonBcxFiles = common.FilesWithExtensions(".bca", ".bck")
                                 .ToArray();
            var commonBtiFiles = common.FilesWithExtension(".bti")
                                 .ToArray();

            var localBcxFiles = directory.FilesWithExtensions(".bca", ".bck")
                                .ToArray();

            if (bmdFiles.Length == 1)
            {
                this.ExtractModels_(node,
                                    bmdFiles,
                                    commonBcxFiles.Concat(localBcxFiles).ToArray(),
                                    commonBtiFiles);
                return;
            }

            try {
                Asserts.True(localBcxFiles.Length == 0);

                this.ExtractPrimaryAndSecondaryModels_(
                    node,
                    bmdFile => bmdFile.Name.StartsWith(
                        "default"),
                    bmdFiles,
                    commonBcxFiles);
            } catch {
                ;
            }
        }