Exemplo n.º 1
0
		protected override void OnPaint(PaintEventArgs e)
		{
			try {
				// Translate the graphics to work the same way the timeline grid does
				// (ie. Drawing coordinates take into account where we start at in time)
				e.Graphics.TranslateTransform(-timeToPixels(VisibleTimeStart), 0);

				drawTicks(e.Graphics, MajorTick, 2, 0.5);
				drawTicks(e.Graphics, MinorTick, 1, 0.25);
				drawTimes(e.Graphics);

				using (Pen p = new Pen(Color.Black, 2)) {
					e.Graphics.DrawLine(p, 0, Height - 1, timeToPixels(TotalTime), Height - 1);
				}

				drawPlaybackIndicators(e.Graphics);

				_drawMarks(e.Graphics);
			}
			catch (Exception ex) {
				//messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
				MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form.
				var messageBox = new MessageBoxForm("Exception in Timeline.Ruler.OnPaint():\n\n\t" + ex.Message + "\n\nBacktrace:\n\n\t" + ex.StackTrace,
					@"Error", false, false);
				messageBox.ShowDialog();
			}
		}
Exemplo n.º 2
0
		public static DialogResult Show (IWin32Window owner, string text, string caption,
						 MessageBoxButtons buttons)
		{
			MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons, MessageBoxIcon.None);
				
			return form.RunDialog ();
		}
Exemplo n.º 3
0
		public static DialogResult Show (string text, string caption)
		{
			MessageBoxForm form = new MessageBoxForm (null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None);

			return form.RunDialog ();
		}
Exemplo n.º 4
0
		public static DialogResult Show (IWin32Window owner, string text)
		{
			MessageBoxForm form = new MessageBoxForm (owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None);
				
			return form.RunDialog ();
		}
Exemplo n.º 5
0
		public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
						 MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
						 string helpFilePath, HelpNavigator navigator, object param)
		{
			MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
								  icon, defaultButton, options, true);
			form.SetHelpData (helpFilePath, null, navigator, param);
			return form.RunDialog ();
		}
Exemplo n.º 6
0
		public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
						 MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
						 string helpFilePath, string keyword)
		{
			MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
								  icon, defaultButton, options, true);
			form.SetHelpData (helpFilePath, keyword, HelpNavigator.TableOfContents, null);
			return form.RunDialog ();
		}
Exemplo n.º 7
0
		public static DialogResult Show (string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
						 MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
						 bool displayHelpButton)
		{
			MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
								  icon, defaultButton, options, displayHelpButton);
			return form.RunDialog ();
		}
Exemplo n.º 8
0
		public static DialogResult Show (IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
						 MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
		{
			MessageBoxForm form = new MessageBoxForm (owner, text, caption, buttons,
								  icon, defaultButton, options, false);
				
			return form.RunDialog ();
		}
Exemplo n.º 9
0
		public static DialogResult Show (string text, string caption, MessageBoxButtons buttons,
						 MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
		{

			MessageBoxForm form = new MessageBoxForm (null, text, caption, buttons,
								  icon, defaultButton, MessageBoxOptions.DefaultDesktopOnly, false);
				
			return form.RunDialog ();
		}
Exemplo n.º 10
0
        public static DialogResult Show(IWin32Window owner, string text, string caption)
        {
            MessageBoxForm form = new MessageBoxForm(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None);

            return(form.RunDialog());
        }
Exemplo n.º 11
0
        public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
        {
            MessageBoxForm form = new MessageBoxForm(null, text, caption, buttons, MessageBoxIcon.None);

            return(form.RunDialog());
        }
Exemplo n.º 12
0
        public static DialogResult Show(string text)
        {
            MessageBoxForm form = new MessageBoxForm(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None);

            return(form.RunDialog());
        }
Exemplo n.º 13
0
		public static DialogResult Show (IWin32Window owner, string text)
		{
			MessageBoxForm form = new MessageBoxForm (owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None);
				
			return form.RunDialog ();
		}
Exemplo n.º 14
0
	public static DialogResult Show(IWin32Window owner, String text, 
									String caption, 
									MessageBoxButtons buttons, 
									MessageBoxIcon icon, 
									MessageBoxDefaultButton defaultButton,
									MessageBoxOptions options)
			{
				MessageBoxForm form = new MessageBoxForm
					(text, caption, buttons, icon,
					 defaultButton, options);
				DialogResult result = form.ShowDialog(owner as Form);
				form.DisposeDialog();
				return result;
			}
Exemplo n.º 15
0
        /// <summary>
        /// 显示一个消息框。
        /// </summary>
        /// <param name="owner">控件拥有者。</param>
        /// <param name="parameters">设置参数。</param>
        /// <returns>返回窗体的操作结果。</returns>
        public static DialogResult ShowMsg(this Control owner, MessageBoxParameters parameters)
        {
            if (owner == null)
                owner = Form.ActiveForm;
            if (owner != null && owner.InvokeRequired)
            {
                return (DialogResult)owner.Invoke(new Func<Control, MessageBoxParameters, DialogResult>(ShowMsg), owner, parameters);
            }
            else
            {
                if (ShowingMsg != null)
                {
                    var e = new ShowingMsgEventArgs(owner, parameters);
                    ShowingMsg(owner, e);
                    if (e.Result != DialogResult.OK)
                        return e.Result;
                }
                if (owner == null)
                {
                    var f = new MessageBoxForm(owner, parameters);
                    var r = f.ShowDialog();
                    parameters.CheckedResult = f.CheckedResult;
                    return r;
                }
                else
                {
                    var ownerForm = owner.FindForm();

                    ownerForm.Activate();
                    var f = new MessageBoxForm(owner, parameters);
                    var r = f.ShowDialog(owner);
                    ownerForm.Activate();
                    parameters.CheckedResult = f.CheckedResult;
                    return r;
                }
            }
        }