Beispiel #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;
		}
        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);
        }
Beispiel #3
0
		public LoggerWrapper(ILogger log, ModelProcessorResult result)
		{
			this.log = log;
			this.result = result;
		}
 public LoggerWrapper(ILogger log, ModelProcessorResult result)
 {
     this.log    = log;
     this.result = result;
 }