Ejemplo n.º 1
0
		public ModelProcessorResult Process()
		{
			ModelProcessorResult result = new ModelProcessorResult();
			result.Success = true;

			log = new LoggerWrapper(Logger, result);

			log.Info("Processing " + filename + " ...");

			var model = GetModel();

			foreach (var type in model.Types)
			{
				if (type.Immutable)
				{
					AddIfNotNull(result.EditableFilenames,
					             CreateFileIfNotExits(type, "ImmutableClassExtended", type.Name, false));
					result.NotToChangeFilenames.Add(CreateFile(type, "ImmutableClass", type.ImplementationName,
					                                           true));
					result.NotToChangeFilenames.Add(CreateFile(type, "BuilderClass", type.Name + "Builder", true));
				}
				else
				{
					AddIfNotNull(result.EditableFilenames,
					             CreateFileIfNotExits(type, "MutableClassExtended", type.Name, false));
					result.NotToChangeFilenames.Add(CreateFile(type, "MutableClass", type.ImplementationName, true));
				}
			}
			log.Info("... Done");
			log.Info("");

			log = null;

			return result;
		}
Ejemplo n.º 2
0
        public ModelProcessorResult Process()
        {
            ModelProcessorResult result = new ModelProcessorResult();

            result.Success = true;

            log = new LoggerWrapper(Logger, result);

            log.Info("Processing " + filename + " ...");

            var model = GetModel();

            foreach (var type in model.Types)
            {
                if (type.Immutable)
                {
                    AddIfNotNull(result.EditableFilenames,
                                 CreateFileIfNotExits(type, "ImmutableClassExtended", type.Name, false));
                    result.NotToChangeFilenames.Add(CreateFile(type, "ImmutableClass", type.ImplementationName,
                                                               true));
                    result.NotToChangeFilenames.Add(CreateFile(type, "BuilderClass", type.Name + "Builder", true));
                }
                else
                {
                    AddIfNotNull(result.EditableFilenames,
                                 CreateFileIfNotExits(type, "MutableClassExtended", type.Name, false));
                    result.NotToChangeFilenames.Add(CreateFile(type, "MutableClass", type.ImplementationName, true));
                }
            }
            log.Info("... Done");
            log.Info("");

            log = null;

            return(result);
        }
Ejemplo n.º 3
0
		public LoggerWrapper(ILogger log, ModelProcessorResult result)
		{
			this.log = log;
			this.result = result;
		}
Ejemplo n.º 4
0
 public LoggerWrapper(ILogger log, ModelProcessorResult result)
 {
     this.log    = log;
     this.result = result;
 }