示例#1
0
        public FileMenu(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal, CloseFormDelegate cfd) {
            this.Text = Strings.File;

            open_deck_ = new OpenDeckMenuItem(model, marshal);
            this.MenuItems.Add(open_deck_);
            this.MenuItems.Add(new CloseDeckMenuItem(dispatcher, model, marshal));
            this.MenuItems.Add(new MenuItem("-"));// Text of "-" signifies a separator bar.
            this.MenuItems.Add(new SaveDeckMenuItem(model, marshal));
            this.MenuItems.Add(new SaveDeckAsMenuItem(model, marshal));
            this.MenuItems.Add(new SaveAllDecksMenuItem(model, marshal));
            this.MenuItems.Add(new SaveAllDecksAsMenuItem(model, marshal));
            this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar.
            this.MenuItems.Add(new ExportDeckAsImageItem(model));
            this.MenuItems.Add(new ExportDeckAsHTMLItem(model));
            this.MenuItems.Add(new ExportInkMenuItem(model));
            this.MenuItems.Add(new MenuItem("-"));
            this.MenuItems.Add(new PageSetupMenuItem(this, model));
            this.MenuItems.Add(new PrintPreviewMenuItem(this, model));
            this.MenuItems.Add(new PrintMenuItem(this, model));
            this.MenuItems.Add(new MenuItem( "-" ));
            this.MenuItems.Add(new ExitMenuItem(cfd));

            presenter_model_ = model;
            presenter_model_.Workspace.CurrentPresentation.ListenAndInitialize(dispatcher, new Property<PresentationModel>.EventHandler(this.HandlePresentationChanged));
            presenter_model_.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher, new Property<DeckTraversalModel>.EventHandler(this.HandleDeckChanged));
        }
示例#2
0
 private void CloseFormWithThread()
 {
     if (dgCloseForm == null)
     {
         dgCloseForm = new CloseFormDelegate(this.Close);
     }
     this.Invoke(dgCloseForm);
 }
示例#3
0
 void SetupDelegates()
 {
     updateServerLogDelegate        = new UpdateServerLogDelegate(UpdateServerLog);
     updateConnectionLabelsDelegate = new UpdateConnectionLabelsDelegate(UpdateConnectionLabels);
     closeFormDelegate = new CloseFormDelegate(CloseForm);
     getNameDelegate   = new GetNameDelegate(GetName);
     getColorDelegate  = new GetColorDelegate(GetColor);
 }
示例#4
0
        public void Stop(IBundleContext context)
        {
            context.RemoveService <Form>(_mainForm);

            CloseFormDelegate closeFormDel = delegate()
            {
                _mainForm.Close();
            };
        }
示例#5
0
 public ServerWindow()//Server_Server server
 {
     InitializeComponent();
     ApplyLayoutChanges();
     updateServerLogDelegate        = new UpdateServerLogDelegate(UpdateServerLog);
     updateConnectionLabelsDelegate = new UpdateConnectionLabelsDelegate(UpdateConnectionLabels);
     closeFormDelegate = new CloseFormDelegate(CloseForm);
     //this.server = server;
     InputBox.Select();
 }
示例#6
0
 public virtual void CloseForm()
 {
     if (this.InvokeRequired)
     {
         CloseFormDelegate dele = new CloseFormDelegate(CloseForm2);
         this.Invoke(dele);
     }
     else
     {
         CloseForm2();
     }
 }
 private void CloseForm()
 {
     if (this.InvokeRequired)
     {
         CloseFormDelegate d = new CloseFormDelegate(CloseForm);
         this.Invoke(d);
     }
     else
     {
         this.Close();
     }
 }
示例#8
0
 public void CloseForm()
 {
     if (InvokeRequired)
     {
         var d = new CloseFormDelegate(CloseForm);
         Invoke(d, new object[] { });
     }
     else
     {
         Close();
     }
 }
 private void CloseForm()
 {
     if (this.InvokeRequired)
     {
         CloseFormDelegate d = new CloseFormDelegate(CloseForm);
         this.Invoke(d);
     }
     else
     {
         this.Close();
     }
 }
示例#10
0
        void AlertForm_AutoCloseFormEvent()
        {
            if (this.InvokeRequired)
            {
                CloseFormDelegate closeForm = new CloseFormDelegate(Close);

                this.Invoke(closeForm);
            }
            else
            {
                this.Close();
            }
        }
示例#11
0
        public frmDownload(DownloadTask downloadTask)
        {
            InitializeComponent();
            this.downloadTask = downloadTask;
            timer             = new Timer();
            timer.Tick       += Timer_Tick;
            timer.Interval    = 100;
            timer.Start();
            DownloadManager.Instance.Download(downloadTask);
            downloadTask.DownloadFinished += DownloadTask_DownloadFinished;
            downloadTask.DownloadFailture += DownloadTask_DownloadFailture;
            progressBar2.Maximum           = 100;
            changeButtonTextDelegate       = new ChangeButtonTextDelegate(ChangeButtonTextDelegateMethod);
            closeFormDelegate              = new CloseFormDelegate(CloseFormDelegateMethod);

            InitLanguageOptions();
        }
示例#12
0
        /// <summary>
        /// 关闭提示框
        /// </summary>
        public void closeMsgForm()
        {
            if (sMessageForm == null)
            {
                return;
            }

            if (sMessageForm.InvokeRequired)
            {
                CloseFormDelegate pro = new CloseFormDelegate(closeMsgForm);
                sMessageForm.Invoke(pro);
            }
            else
            {
                sMessageForm.Close();
                sMessageForm.Dispose();
                this.Close();
                this.Dispose();
            }
        }
示例#13
0
 private void CloseForm()
 {
     if (this.InvokeRequired == true)
     {
         CloseFormDelegate d = new CloseFormDelegate(CloseForm);
         try
         {
             this.Invoke(d);
         }
         catch
         {
             // do no_op
         }
     }
     else
     {
         isThreadStarted = false;
         this.Close();
     }
 }
示例#14
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">True if managed resources should be disposed; otherwise, false.</param>
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                lock (_syncRoot) {
                    System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;

                    _hideEvent.Set();
                    _hideEvent.Close();

                    if (_form != null)
                    {
                        if (_form.IsHandleCreated)
                        {
                            CloseFormDelegate methodCloseForm = new CloseFormDelegate(CloseForm);
                            _form.Invoke(methodCloseForm, _form);
                        }
                        if (!_form.IsDisposed)
                        {
                            _form.Dispose();
                        }
                        _form = null;
                    }
                    if (_label != null)
                    {
                        _label.Dispose();
                        _label = null;
                    }
                    if (_progressBar != null)
                    {
                        _progressBar.Dispose();
                        _progressBar = null;
                    }
                }
            }
        }
示例#15
0
 public ExitMenuItem(CloseFormDelegate cfd)
 {
     this.Text  = Strings.Exit;
     this.m_CFD = cfd;
 }
示例#16
0
 public virtual void CloseForm()
 {
     if (this.InvokeRequired)
     {
         CloseFormDelegate dele = new CloseFormDelegate(CloseForm2);
         this.Invoke(dele);
     }
     else
     {
         CloseForm2();
     }
 }
示例#17
0
        void RegisterMachineID_AutoCloseFormEvent()
        {
            if (this.InvokeRequired)
            {
                CloseFormDelegate closeForm = new CloseFormDelegate(Close);

                this.Invoke(closeForm);
            }
            else
            {
                this.Close();
            }
        }
示例#18
0
 private void CloseForm(Form form)
 {
     if (this.InvokeRequired)
     {
         CloseFormDelegate d = new CloseFormDelegate(CloseForm);
         this.Invoke(d, form);
     }
     else
     {
         form.Close();
     }
 }
示例#19
0
        public Form1()
        {
            InitializeComponent();
            FormClosing += Form1_FormClosing;
            myDelegate = new CloseFormDelegate(CloseMyForm);

            //Sets how many simultaneous bots you can have open
            //int maxBots;
            //if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > maxBots) System.Diagnostics.Process.GetCurrentProcess().Kill();

            Authorize();
            int x = Screen.PrimaryScreen.Bounds.Right - this.Width;
            int y = Screen.PrimaryScreen.Bounds.Top + 3;
            this.Location = new Point(x, y);
            //this.TopMost = true;
            if (!Directory.Exists(fileLocation))
            {
                DirectoryInfo info = Directory.CreateDirectory(fileLocation);
            }
        }
示例#20
0
        public FileMenu(ControlEventQueue dispatcher, PresenterModel model, DeckMarshalService marshal, CloseFormDelegate cfd)
        {
            this.Text = Strings.File;

            open_deck_ = new OpenDeckMenuItem(model, marshal);
            this.MenuItems.Add(open_deck_);
            this.MenuItems.Add(new CloseDeckMenuItem(dispatcher, model, marshal));
            this.MenuItems.Add(new MenuItem("-"));// Text of "-" signifies a separator bar.
            this.MenuItems.Add(new SaveDeckMenuItem(model, marshal));
            this.MenuItems.Add(new SaveDeckAsMenuItem(model, marshal));
            this.MenuItems.Add(new SaveAllDecksMenuItem(model, marshal));
            this.MenuItems.Add(new SaveAllDecksAsMenuItem(model, marshal));
            this.MenuItems.Add(new MenuItem("-")); // Text of "-" signifies a separator bar.
            this.MenuItems.Add(new ExportDeckAsImageItem(model));
            this.MenuItems.Add(new ExportDeckAsHTMLItem(model));
            this.MenuItems.Add(new ExportInkMenuItem(model));
            this.MenuItems.Add(new MenuItem("-"));
            this.MenuItems.Add(new PageSetupMenuItem(this, model));
            this.MenuItems.Add(new PrintPreviewMenuItem(this, model));
            this.MenuItems.Add(new PrintMenuItem(this, model));
            this.MenuItems.Add(new MenuItem("-"));
            this.MenuItems.Add(new ExitMenuItem(cfd));

            presenter_model_ = model;
            presenter_model_.Workspace.CurrentPresentation.ListenAndInitialize(dispatcher, new Property <PresentationModel> .EventHandler(this.HandlePresentationChanged));
            presenter_model_.Workspace.CurrentDeckTraversal.ListenAndInitialize(dispatcher, new Property <DeckTraversalModel> .EventHandler(this.HandleDeckChanged));
        }
        public Caculating()
        {
            InitializeComponent();

            myDelegate = new CloseFormDelegate(CloseMyForm);
        }
示例#22
0
 public ExitMenuItem(CloseFormDelegate cfd) {
     this.Text = Strings.Exit;
     this.m_CFD = cfd;
 }