public void SetProgressSource(CProgress source) { ProgressSource = source; Update(); }
private void loadProblem() { try { Console.Write("Try to load {0}... ", file.FileName); Assembly asm = Assembly.LoadFrom(file.FileName); Console.Write("OK\nTry to create the Algorithm Object... "); this.algo = asm.CreateInstance("ProjectEuler.Algorithm"); Console.WriteLine("OK"); this.available = true; if (algo is IProgress) { Console.WriteLine("Found IProgress interface implement"); Progress = new CProgress(); Progress = ((IProgress)algo).Progress; } } catch (Exception e) { Console.WriteLine("Failed with exception\nMESSAGE: {0}", e.Message); this.available = false; this.algo = null; } }