Exemple #1
0
 public MainForm()
 {
     InitializeComponent();
     _presenter = new MainViewPresenter(this);
     HookupEventHandlers();
     HookupExtraKeyboardShortcuts();
 }
Exemple #2
0
      //  private static System.Timers.Timer aTimer;
      //  delegate void SetTextCallback(string text);

//       [System.Runtime.InteropServices.DllImport("User32")]
  //      private extern static int GetGuiResources(IntPtr hProcess, int uiFlags);

//        private void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
  //      {
            //statusLabel.Text
//                if (this.statusLabel.InvokeRequired)
  //  {
        // It's on a different thread, so use Invoke.

    //        string h = "";
      //  using (Process process = Process.GetCurrentProcess())
    //    {
    //        var gdiHandles = GetGuiResources(process.Handle, 0);
    //        var userHandles = GetGuiResources(process.Handle, 1);
    //        h = gdiHandles.ToString() + " , " + userHandles.ToString();
      //  }

        //SetTextCallback d = new SetTextCallback(SetText);
        //this.Invoke(d, new object[] {h});
    //}
    //else
    //{
        // It's on the same thread, no need for Invoke 
        //SetTextCallback d = new SetTextCallback(SetText);
        //this.statusLabel.Text= e.SignalTime.ToShortTimeString();
    //    }
//        private void SetText(string text)
  //      {
    //        this.statusLabel.Text = text;
      //  }
        public MainForm()
        {
            InitializeComponent();
            _presenter = new MainViewPresenter(this);
            HookupEventHandlers();
            HookupExtraKeyboardShortcuts();

        /*    aTimer = new System.Timers.Timer();
            aTimer.Interval = 500;
            aTimer.Elapsed += OnTimedEvent;
            aTimer.Enabled = true;*/
        }
Exemple #3
0
        //  private static System.Timers.Timer aTimer;
        //  delegate void SetTextCallback(string text);

//       [System.Runtime.InteropServices.DllImport("User32")]
//      private extern static int GetGuiResources(IntPtr hProcess, int uiFlags);

//        private void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
//      {
        //statusLabel.Text
//                if (this.statusLabel.InvokeRequired)
//  {
        // It's on a different thread, so use Invoke.

        //        string h = "";
        //  using (Process process = Process.GetCurrentProcess())
        //    {
        //        var gdiHandles = GetGuiResources(process.Handle, 0);
        //        var userHandles = GetGuiResources(process.Handle, 1);
        //        h = gdiHandles.ToString() + " , " + userHandles.ToString();
        //  }

        //SetTextCallback d = new SetTextCallback(SetText);
        //this.Invoke(d, new object[] {h});
        //}
        //else
        //{
        // It's on the same thread, no need for Invoke
        //SetTextCallback d = new SetTextCallback(SetText);
        //this.statusLabel.Text= e.SignalTime.ToShortTimeString();
        //    }
//        private void SetText(string text)
//      {
//        this.statusLabel.Text = text;
//  }
        public MainForm()
        {
            InitializeComponent();
            _presenter = new MainViewPresenter(this);
            HookupEventHandlers();
            HookupExtraKeyboardShortcuts();

            /*    aTimer = new System.Timers.Timer();
             *  aTimer.Interval = 500;
             *  aTimer.Elapsed += OnTimedEvent;
             *  aTimer.Enabled = true;*/
        }