Ejemplo n.º 1
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (hagen != null)
                    {
                        hagen.Dispose();
                        hagen = null;
                    }
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
Ejemplo n.º 2
0
        public void RunUserInterface()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            log4net.Config.BasicConfigurator.Configure();

            var logViewer = new LogViewer2()
            {
                Text      = "Log",
                Threshold = log4net.Core.Level.Info
            };

            logViewer.AddToRoot();

            log.Info("Startup");

            KillAlreadyRunning();

            hagen = new Hagen();
            hagen.Context.Choose = _ => ActionChooser.Choose(hagen.Context, _);

            main = new Main(hagen);

            foreach (var i in this.pluginAssemblyPaths)
            {
                main.LoadPlugin(i);
            }

            main.AddPanel(logViewer);

            if (Popup)
            {
                main.Popup();
            }

            Application.Run(main);
        }
Ejemplo n.º 3
0
 public Context(Hagen hagen)
 {
     this.hagen        = hagen;
     lastExecutedStore = hagen.OpenLastExecutedStore();
     NotifyAction      = x => log.Info(x);
 }
Ejemplo n.º 4
0
 public Main(Hagen hagen)
 {
     this.hagen = hagen;
     InitUserInterface();
 }