本文整理汇总了C#中Settings.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.Load方法的具体用法?C# Settings.Load怎么用?C# Settings.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings.Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
/// ------------------------------------------------------------------------------------
/// <summary>
/// Executes the task.
/// </summary>
/// ------------------------------------------------------------------------------------
public override bool Execute()
{
Log.LogMessage(MessageImportance.Normal, "Gendarmalyzing {0}", Assembly);
CheckDependencies();
var runner = new MsBuildRunner(Log, m_LogType, LogFile);
var config = new Settings(runner, ConfigurationFile, RuleSet);
config.Load();
var assemblyDef = AssemblyDefinition.ReadAssembly(Assembly,
new ReaderParameters { AssemblyResolver = AssemblyResolver.Resolver });
runner.Assemblies.Add(assemblyDef);
runner.AutoUpdateIgnore = AutoUpdateIgnores;
runner.AddIgnoreFile(IgnoreFile);
runner.Initialize();
runner.Run();
runner.WriteReport();
if (m_LogType == LogTypeEnum.None || (m_LogType == LogTypeEnum.Plain && string.IsNullOrEmpty(LogFile)))
runner.PrintInScreen();
if (runner.Defects.Count > 0)
{
string message;
if (m_LogType == LogTypeEnum.None || (m_LogType == LogTypeEnum.Plain && string.IsNullOrEmpty(LogFile)))
message = string.Format("Gendarme found {0} defects in code", runner.Defects.Count);
else
{
message = string.Format("Gendarme found {0} defects in code. See {1} for details.",
runner.Defects.Count, LogFile);
}
Log.LogError(message);
}
return !(Log.HasLoggedErrors && VerifyFail);
}
示例2: LoadSettings
public bool LoadSettings()
{
var s = new Settings();
if (s.Load(Settings.DefaultFilePath))
{
_settings = s;
return true;
}
return false;
}
示例3: Initializer
public Initializer()
{
new FileChecker();
_saver = new MainSaver(_logger);
this.Settings = new Settings(_logger);
Settings.Load(ConfigSaveLocation);
Settings.SetSavePath(ConfigSaveLocation);
if (Settings.Get<bool>(_names.Console))
_logger.ChangeLogger(new ConsoleLogger(Settings));
else
_logger.ChangeLogger(new EmptyLogger());
_logger.AddLogger(new FileLogger(_saver, Settings));
_logger.Log("booting up...", LogLevel.Basic);
}
示例4: Register
private void Register()
{
var containerBuilder = new ContainerBuilder();
containerBuilder.RegisterType<WebApiClient>().As<IWebApiClient>().SingleInstance();
containerBuilder.RegisterType<WebApiHost>().As<IWebApiHost>().SingleInstance();
containerBuilder.RegisterType<MainWindowViewModel>().SingleInstance();
containerBuilder.RegisterType<LoginViewModel>();
containerBuilder.RegisterType<SellViewModel>();
containerBuilder.RegisterType<SettingsViewModel>().SingleInstance();
containerBuilder.RegisterType<FiscalPrinterHandler>().SingleInstance();
containerBuilder.RegisterType<LotteryTicketChecker>().SingleInstance();
var settings = new Settings();
settings.Load();
containerBuilder.RegisterInstance(settings).SingleInstance();
Container = containerBuilder.Build();
}
示例5: GetModFpkFiles
public static List<string> GetModFpkFiles()
{
Settings settings = new Settings();
settings.Load();
List<string> fpkList = new List<string>();
foreach (ModEntry mod in settings.ModEntries)
{
foreach (ModFpkEntry fpkFile in mod.ModFpkEntries)
{
fpkList.Add(Tools.ToQarPath(fpkFile.FilePath));
}
}
return fpkList;
}
示例6: ApplicationData
/// <summary>
///
/// </summary>
/// <param name="settings"></param>
/// <param name="project"></param>
/// <param name="settingFileName"></param>
public ApplicationData(Settings settings, Project project, string settingFileName)
{
m_setting = settings;
m_setting.Load(settingFileName);
m_project = project;
}
示例7: LoadFromTable
public static Settings LoadFromTable(Table t) {
Settings s = new Settings();
s.Load(t);
return s;
}
示例8: SetGameData
public static void SetGameData(GameData NewGameData)
{
Settings settings = new Settings();
settings.Load();
settings.GameData = NewGameData;
settings.Save();
}
示例9: UpdateDatHash
public static void UpdateDatHash()
{
Settings settings = new Settings();
settings.Load();
// Hash 01.dat and update settings file
string datHash = Tools.GetMd5Hash(ModManager.ZeroPath);
settings.GameData.DatHash = datHash;
settings.Save();
}
示例10: GetSettingsVersion
public static Version GetSettingsVersion()
{
Settings settings = new Settings();
settings.Load();
return settings.SbVersion.AsVersion();
}
示例11: RemoveMod
public static void RemoveMod(ModEntry Mod)
{
Settings settings = new Settings();
settings.Load();
ModEntry remMod = settings.ModEntries.Find(entry => entry.Name == Mod.Name);
settings.ModEntries.Remove(remMod);
settings.Save();
}
示例12: PDBFiles
public PDBFiles()
{
Settings set = new Settings();
set.Load();
mode = set.mode;
}
示例13: GetDistance
public override int[] GetDistance(string refStructure, List<string> structures)
{
int[] dist = new int[structures.Count];
distanceMatrix = new int[structures.Count];
Settings set = new Settings();
set.Load();
int threadNumbers = set.numberOfCores;
this.structures = new List<string>(structures);
int part = this.structNames.Count / threadNumbers;
indexList = new List<KeyValuePair<int, int>>[threadNumbers];
for (int j = 0; j < indexList.Length; j++)
{
indexList[j] = new List<KeyValuePair<int, int>>();
}
int count = 0;
for (int j = 0; j < this.structures.Count; j++)
{
if (indexList[count].Count < part)
{
KeyValuePair<int, int> aux = new KeyValuePair<int, int>(j, 0);
indexList[count].Add(aux);
}
else
count++;
}
this.structures.Add(refStructure);
resetEvents = new ManualResetEvent[threadNumbers];
for (int n = 0; n < threadNumbers; n++)
{
int k = n;
resetEvents[n] = new ManualResetEvent(false);
ThreadPool.QueueUserWorkItem(new WaitCallback(CalcMatrixList), (object)k);
}
for (int j = 0; j < threadNumbers; j++)
resetEvents[j].WaitOne();
for (int j = 0; j < this.structures.Count - 1; j++)
dist[j] = distanceMatrix[j];
return dist;
}
示例14: GetInstalledMods
public static List<ModEntry> GetInstalledMods()
{
Settings settings = new Settings();
settings.Load();
return settings.ModEntries;
}
示例15: GetGameData
public static GameData GetGameData()
{
Settings settings = new Settings();
settings.Load();
return settings.GameData;
}