Esempio n. 1
0
        protected AbstractExtensionBuilderDependency(string name, IExtensionBuilderDependency parentDependency = null)
            : base(name)
        {
            if (parentDependency.IsNotNull())
            {
                BaseDirectory     = parentDependency.BaseDirectory;
                ConfigDirectory   = parentDependency.ConfigDirectory;
                ReportDirectory   = parentDependency.ReportDirectory;
                ResourceDirectory = parentDependency.ResourceDirectory;

                ConfigurationRoot = parentDependency.ConfigurationRoot;

                if (ConfigurationRoot.IsNotNull())
                {
                    Configuration = ConfigurationRoot.GetSection(Name);
                }

                ParentDependency = parentDependency;
            }
            else
            {
                var currentDirectory = Environment.CurrentDirectory.WithoutDevelopmentRelativePath();

                BaseDirectory     = currentDirectory;
                ConfigDirectory   = currentDirectory.CombinePath(CoreSettings.Preference.ConfigsFolder);
                ReportDirectory   = currentDirectory.CombinePath(CoreSettings.Preference.ReportsFolder);
                ResourceDirectory = currentDirectory.CombinePath(CoreSettings.Preference.ResourcesFolder);
            }
        }