Пример #1
0
        public IReadOnlyDictionary <string, BuildPhase?> GetModelLoadInfo(HostService hostService)
        {
            string name = hostService.Processor.Name;
            Dictionary <string, BuildPhase?> mi;

            if (ModelLoadInfo.TryGetValue(name, out mi))
            {
                return(mi);
            }
            return(new Dictionary <string, BuildPhase?>());
        }
Пример #2
0
        public IReadOnlyDictionary <string, BuildPhase?> GetModelLoadInfo(HostService hostService)
        {
            string name = hostService.Processor.Name;

            if (!hostService.ShouldTraceIncrementalInfo)
            {
                throw new InvalidOperationException($"HostService: {name} doesn't record incremental info, cannot call the method to get model load info.");
            }
            if (ModelLoadInfo.TryGetValue(name, out OSPlatformSensitiveDictionary <BuildPhase?> mi))
            {
                return(mi);
            }
            return(new OSPlatformSensitiveDictionary <BuildPhase?>());
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="metaModelProviders">Instance of <c>IMetaModelProvider</c></param>
        /// <param name="metaModelService">Instance of <c>IMetaModelService</c></param>
        /// <param name="modelInfoCollection">Instance of <c>ModelInfoCollection</c></param>
        /// <returns>Instance of <c>AXLabelFile</c></returns>
        public AxLabelFile GetLabelFile()
        {
            // Choose the first model in the collection
            ModelInfo modelInfo = ((System.Collections.ObjectModel.Collection <ModelInfo>)modelInfoCollection)[0];

            // Construct a ModelLoadInfo
            ModelLoadInfo modelLoadInfo = new ModelLoadInfo
            {
                Id    = modelInfo.Id,
                Layer = modelInfo.Layer,
            };

            // Get the list of label files from that model
            IList <String> labelFileNames = metaModelProvider.CurrentMetadataProvider.LabelFiles.ListObjectsForModel(modelInfo.Name);

            // Choose the first
            // What happens if there is no label file?
            AxLabelFile labelFile = MetaModelService.GetLabelFile(labelFileNames[0], modelLoadInfo);

            return(labelFile);
        }