public SettingSetValueSheet GetSetting(string filename) { DirectoryInfo d = new DirectoryInfo(GetFolderPath()); var p = d.GetFiles().ToList(); List <string> list = new List <string>(); p.ForEach(x => list.Add(x.Name)); if (list.Count == 0) { SettingSetValueSheet setting = SettingExtension.GetSetting <SettingSetValueSheet>(GetFullFileName("%^^")); if (setting == null) { setting = new SettingSetValueSheet(); } return(setting); } else { var fg = GetFullFileName(filename); SettingSetValueSheet setting = SettingExtension.GetSetting <SettingSetValueSheet>(GetFullFileName(filename)); if (setting == null) { setting = new SettingSetValueSheet(); } return(setting); } }
public virtual string GetConfiguration(Dictionary <string, string> options) { //Schedule settings have lowest priority, because there is currently no setup SetupSchedule(options); //Now setup the environment ApplicationSettings appSet = new ApplicationSettings(this.Task.DataParent); if (this.Task.ExistsInDb && appSet.SignatureCacheEnabled && !string.IsNullOrEmpty(appSet.SignatureCachePath)) { options["signature-cache-path"] = System.IO.Path.Combine(System.Environment.ExpandEnvironmentVariables(appSet.SignatureCachePath), this.Task.Schedule.ID.ToString()); } if (!string.IsNullOrEmpty(appSet.TempPath)) { string tempdir = System.Environment.ExpandEnvironmentVariables(appSet.TempPath); if (!System.IO.Directory.Exists(tempdir)) { System.IO.Directory.CreateDirectory(tempdir); } options["tempdir"] = tempdir; } Dictionary <string, string> env = appSet.CreateDetachedCopy(); //Inject the encryption, backend and compression module names into the environment env["encryption-module"] = this.Task.EncryptionModule; env["compression-module"] = this.Task.CompressionModule; env["backend-module"] = this.Task.Service; //If there are any control extensions, let them modify the environment foreach (Library.Interface.ISettingsControl ic in Library.DynamicLoader.SettingsControlLoader.Modules) { ic.GetConfiguration(env, SettingExtension.GetExtensions(this.Task.Schedule.DataParent, ic.Key), options); } //Setup encryption module SetupEncryptionModule(env, this.Task.EncryptionSettingsLookup, options); //Setup compression module SetupCompressionModule(env, this.Task.CompressionSettingsLookup, options); //Next is the actual backend setup string destination = SetupBackend(env, options); //Setup any task options SetupTask(options); //Setup any task extension options SetupTaskExtensions(options); //Override everything set in the overrides, this is placed last so it cannot be overriden elsewhere foreach (TaskOverride ov in this.Task.TaskOverrides) { options[ov.Name] = ov.Value; } return(destination); }
public static void SaveExtensionSettings(IDataFetcher connection, IDictionary <string, string> env) { //If there are any control extensions, let them modify the environement foreach (Library.Interface.ISettingsControl ic in Library.DynamicLoader.SettingsControlLoader.Modules) { ic.EndEdit(env, SettingExtension.GetExtensions(connection, ic.Key)); } }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.14.Settingplacesymbolongravity"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public SettingCheckClashProduct GetSetting() { SettingCheckClashProduct setting = SettingExtension.GetSetting <SettingCheckClashProduct>(GetFullFileName()); if (setting == null) { setting = new SettingCheckClashProduct(); } return(setting); }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.23.SettingCheckClashProduct"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.11.SettingBrick"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public SettingAdutodimelement GetSetting() { SettingAdutodimelement setting = SettingExtension.GetSetting <SettingAdutodimelement>(GetFullFileName()); if (setting == null) { setting = new SettingAdutodimelement(); } return(setting); }
public SettingDimgrid GetSetting() { SettingDimgrid setting = SettingExtension.GetSetting <SettingDimgrid>(GetFullFileName()); if (setting == null) { setting = new SettingDimgrid(); } return(setting); }
public SettingCreateGrid3d GetSetting() { SettingCreateGrid3d setting = SettingExtension.GetSetting <SettingCreateGrid3d>(GetFullFileName()); if (setting == null) { setting = new SettingCreateGrid3d(); } return(setting); }
public SettingSelecelementbymark GetSetting() { SettingSelecelementbymark setting = SettingExtension.GetSetting <SettingSelecelementbymark>(GetFullFileName()); if (setting == null) { setting = new SettingSelecelementbymark(); } return(setting); }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.15.SettingSelecelementbymark"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public SettingSelectCustom GetSetting() { SettingSelectCustom setting = SettingExtension.GetSetting <SettingSelectCustom>(GetFullFileName()); if (setting == null) { setting = new SettingSelectCustom(); } return(setting); }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.49.SettingSelectCustom"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public Settingplacesymbolongaravity GetSetting() { Settingplacesymbolongaravity setting = SettingExtension.GetSetting <Settingplacesymbolongaravity>(GetFullFileName()); if (setting == null) { setting = new Settingplacesymbolongaravity(); } return(setting); }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.22.SettingAutodimelement"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public SettingManagerSection GetSetting() { SettingManagerSection setting = SettingExtension.GetSetting <SettingManagerSection>(GetFullFileName()); if (setting == null) { setting = new SettingManagerSection(); } return(setting); }
public SettingAddview GetSetting() { SettingAddview setting = SettingExtension.GetSetting <SettingAddview>(GetFullFileName()); if (setting == null) { setting = new SettingAddview(); } return(setting); }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.47.SettingManagerSection"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public SettingTopDT GetSetting() { SettingTopDT setting = SettingExtension.GetSetting <SettingTopDT>(GetFullFileName()); if (setting == null) { setting = new SettingTopDT(); } return(setting); }
public string GetFolderPath() { string folderPath = SettingExtension.GetSettingPath() + "\\TVD.53.SettingSetValueSheet"; if (!Directory.Exists(folderPath)) { Directory.CreateDirectory(folderPath); } return(folderPath); }
public SettingProductonlevel GetSetting() { SettingProductonlevel setting = SettingExtension.GetSetting <SettingProductonlevel>(GetFullFileName()); if (setting == null) { setting = new SettingProductonlevel(); } return(setting); }
public static Dictionary <string, string> GetApplicationSettings(IDataFetcher connection) { Dictionary <string, string> env = new ApplicationSettings(connection).CreateDetachedCopy(); //If there are any control extensions, let them modify the environement foreach (Library.Interface.ISettingsControl ic in Library.DynamicLoader.SettingsControlLoader.Modules) { ic.BeginEdit(env, SettingExtension.GetExtensions(connection, ic.Key)); } return(env); }
public void Settings_Usage() { var tree = ExcessMock.Compile(@" namespace SomeNS { settings { [SomeSection] SomeIntValue = 12 SomeStringValue = ""Hello"" [SomeOtherSection] SomeOtherValue = ""World"" } }", builder: (compiler) => SettingExtension.Apply(compiler)); Assert.IsNotNull(tree); //must have created a class var @class = tree .GetRoot() .DescendantNodes() .OfType <ClassDeclarationSyntax>() .Single(); //with an "__init" method var method = @class .DescendantNodes() .OfType <MethodDeclarationSyntax>() .Single(); Assert.AreEqual("__init", method.Identifier.ToString()); //with 3 statements Assert.AreEqual(3, method.Body.Statements.Count); //all containing a call to ConfigurationManager Assert.AreEqual(3, method .Body .DescendantNodes() .OfType <MemberAccessExpressionSyntax>() .Where(inv => inv.Expression.ToString() == "ConfigurationManager") .Count()); }
public void SaveSetting(string filename) { SettingExtension.SaveSetting(this, GetFullFileName(filename)); }
public void SaveSetting() { var gh = GetFullFileName(); SettingExtension.SaveSetting(this, GetFullFileName()); }