private static void Main() { if (InstanceExists()) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); // TODO: Resolve factory as a depenedency by means of some DI solution. DefaultFactory Factory = new DefaultFactory(); try { HoloCore Core = new HoloCore(Factory); MainForm MainForm = new MainForm(Core) { Icon = Resource.HOLO }; Core.SetView(MainForm); Application.Run(MainForm); Core.SaveDatabase(); } catch (Exception E) { Logger.FatalException("Unhandled exception at the top level.", E); MessageBox.Show(E.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public MainForm(HoloCore core) { if (core == null) { throw new ArgumentNullException("core"); } Core = core; InitializeComponent(); tmProcessing = new System.Timers.Timer(1000); tmProcessing.Elapsed += tmProcessing_Elapsed; tmProcessing.Start(); }
public AlgorithmEstimator(HoloCore core, string hashMapPath, string scoresPath, Func <int, int, int> transformRankToScore) { if (core == null) { throw new ArgumentNullException("core"); } if (transformRankToScore == null) { throw new ArgumentNullException("transformRankToScore"); } Core = core; TransformRankToScore = transformRankToScore; HashMap = LoadHashes(hashMapPath); ManualScores = LoadScores(HashMap, scoresPath); }
public AlgorithmEstimator(HoloCore core, string hashMapPath, string scoresPath) : this(core, hashMapPath, scoresPath, DefaultRankToScore) { }