Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GenerationContext"/> class.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <param name="modelFileName">Name of the model file.</param>
 /// <param name="selectedModel">The selected model.</param>
 public GenerationContext(CandleModel model, string modelFileName, Guid selectedModel)
 {
     _model         = model;
     _modelFileName = modelFileName;
     _selectedModel = selectedModel;
     _mode          = new ConfigurationMode();
 }
Пример #2
0
        /// <summary>
        /// Récupére la liste des services utilisés par cette couche. Cette méthode assure que les services sont uniques.
        /// </summary>
        /// <param name="mode">Mode à prendre en compte</param>
        /// <returns></returns>
        public List <ClassUsesOperations> GetServicesUsed(ConfigurationMode mode)
        {
            List <ClassUsesOperations> services = new List <ClassUsesOperations>();
            List <TypeWithOperations>  types    = GetImplementations();

            if (types == null || types.Count == 0)
            {
                return(services);
            }

            List <Guid> doublons = new List <Guid>();

            foreach (TypeWithOperations clazz in types)
            {
                foreach (ClassUsesOperations service in ClassUsesOperations.GetLinksToServicesUsed(clazz))
                {
                    if (!mode.CheckConfigurationMode(service.ConfigurationMode) ||
                        doublons.Contains(service.TargetService.Id))
                    {
                        continue;
                    }
                    doublons.Add(service.TargetService.Id);
                    services.Add(service);
                }
            }
            return(services);
        }