public SerilizationGeneration(GeneratorWorkspace generatorWorkspace)
        {
            _generatorWorkspace = generatorWorkspace;

            var configuration = ConfigurationSettings.GetConfig("serialize") as SerializeConfiguration;
            if (configuration != null)
            {
                _projectNames = configuration.AllProjectNames;
                _generationPrefix = configuration.GenerationPrefix;
                _includeAttribute = configuration.IncludeAtribute;
                _ignoreAttribute = configuration.IgnoreAttribute;
                _baseInterface = configuration.BaseInterface;
                _helpProjects = configuration.AllHelpProjectNames;
                _mappingAttribute = configuration.MappingAttribute;
                _mappingIgnoreAttribute = configuration.MappingIgnoreAttribute;
            }
        }
 public RepositoryCodeFactory(IEnumerable<RepositoryProject> configs, GeneratorWorkspace ws)
 {
     _configurations = configs;
     _generatorWorkspace = ws;
 }
 public DecoratorCodeFactory(IReadOnlyCollection<DecoratorConfiguration> configs, GeneratorWorkspace ws)
 {
     _configurations = configs;
     _generatorWorkspace = ws;
 }
예제 #4
0
        static void Main(string[] args)
        {
            // Set path to app.config for current application domain
            if (args != null && args.Any() && !string.IsNullOrEmpty(args[0]))
            {
                var absoluteConfigPath = Path.GetFullPath(args[0]);

                if (!File.Exists(absoluteConfigPath))
                {
                    throw new ArgumentException("File of configuration file not found");
                }

                AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", absoluteConfigPath);
            }

            // Get solution
            Console.WriteLine("Open solulion");

            var solutionPath = ConfigurationManager.AppSettings["SolutionPath"];
            var absoluteSlnPath = Path.GetFullPath(solutionPath);

            if (!File.Exists(absoluteSlnPath))
            {
                throw new ArgumentException("File of solution not found");
            }

            // Create workspace - open solution
            _generatorWorkspace = new GeneratorWorkspace(absoluteSlnPath);

            Console.WriteLine("Solulion opened");

            try
            {
                RunRepositoryGeneration();
            }
            catch (Exception e)
            {
                throw new ApplicationException("Error occured on repository generation", e);
            }

            try
            {
                RunSerializeGeneration();
            }
            catch (Exception e)
            {
                throw new ApplicationException("Error occured on serialize generation", e);
            }

            try
            {
                RunWcfGeneration();
            }
            catch (Exception e)
            {
                throw new ApplicationException("Error occured on wcf generation.", e);
            }

            try
            {
                RunDecoratorGeneration();
            }
            catch (Exception e)
            {
                throw new ApplicationException("Error occured on decorator generation.", e);
            }

            // Apply Changes, close solution
            _generatorWorkspace.CloseSolution();
        }
예제 #5
0
 public WcfGenerator(GeneratorWorkspace generatorWorkspace)
 {
     _generatorWorkspace = generatorWorkspace;
 }
 public DecoratorService(GeneratorWorkspace workSpace, DecoratorConfiguration configuration)
 {
     _workSpace = workSpace;
     _configuration = configuration;
     _syntaxWalker = new SyntaxWalker(_workSpace.Solution, configuration.SolutionProjectName);
 }
 public void OpenSolution(GeneratorWorkspace generatorWorkspace)
 {
     GeneratorWorkspace = generatorWorkspace;
 }