Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            Focus();

            this.previewServer = ConfigurationManager.AppSettings["ss_server"] ?? "http://ss.cavelis.net:3001";

            this.Loaded += (sender, e) => {
                var context = (MainWindowViewModel)this.DataContext;

                context.OnMessage += (message, config) => {
                    var commentState = config.CommentPopupType;
                    if (commentState == Config.CommentPopupDisplayType.None)
                    {
                        return;
                    }

                    if (commentState == Config.CommentPopupDisplayType.Minimize && this.Root.WindowState != System.Windows.WindowState.Minimized)
                    {
                        return;
                    }

                    if (message.IsBan == true)
                    {
                        return;
                    }

                    var balloon = new MessageBalloon();
                    balloon.DataContext = message;
                    var timeout = config.CommentPopupTime * 1000;
                    this.MyNotifyIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, timeout);
                };
            };
        }
Example #2
0
		/// <summary>
		/// When the balloon is hidden reset our internal reference to null
		/// </summary>
		private void m_Balloon_VisibleChanged(object sender, EventArgs e)
		{
			if ( !( sender as System.Windows.Forms.Control ).Visible )
			{
				m_Balloon = null;
			}
		}
Example #3
0
        void HideMessageTip()
        {
            if (m_firstUseBalloon == null)
            {
                return;
            }

            m_firstUseBalloon.Dispose();
            m_firstUseBalloon = null;
        }
Example #4
0
        void ShowMessageTip()
        {
            m_firstUseBalloon           = new MessageBalloon();
            m_firstUseBalloon.Parent    = this.textBox_instanceName;
            m_firstUseBalloon.Title     = "创建第一个实例";
            m_firstUseBalloon.TitleIcon = TooltipIcon.Info;
            m_firstUseBalloon.Text      = "对于第一个实例(或者唯一的实例)来说,可以让实例名保持为空,这样,缺省的数据目录名和协议路径都可以简短一些";

            m_firstUseBalloon.Align                  = BalloonAlignment.BottomRight;
            m_firstUseBalloon.CenterStem             = false;
            m_firstUseBalloon.UseAbsolutePositioning = false;
            m_firstUseBalloon.Show();
        }
Example #5
0
        void ShowMessageTip()
        {
            m_firstUseBalloon           = new MessageBalloon();
            m_firstUseBalloon.Parent    = this.button_newInstance;
            m_firstUseBalloon.Title     = "安装 dp2OPAC 图书馆公共查询";
            m_firstUseBalloon.TitleIcon = TooltipIcon.Info;
            m_firstUseBalloon.Text      = "请按此按钮创建第一个实例";

            m_firstUseBalloon.Align                  = BalloonAlignment.BottomRight;
            m_firstUseBalloon.CenterStem             = false;
            m_firstUseBalloon.UseAbsolutePositioning = false;
            m_firstUseBalloon.Show();
        }
Example #6
0
        void ShowMessageTip()
        {
            m_firstUseBalloon           = new MessageBalloon();
            m_firstUseBalloon.Parent    = this.button_newServer;
            m_firstUseBalloon.Title     = "欢迎使用dp2编目前端";
            m_firstUseBalloon.TitleIcon = TooltipIcon.Info;
            m_firstUseBalloon.Text      = "请按此按钮创建第一个 dp2library 服务器目标";

            m_firstUseBalloon.Align                  = BalloonAlignment.BottomRight;
            m_firstUseBalloon.CenterStem             = false;
            m_firstUseBalloon.UseAbsolutePositioning = false;
            m_firstUseBalloon.Show();
        }
Example #7
0
        void HideMessageTip()
        {
            if (m_firstUseBalloon == null)
            {
                return;
            }

            m_firstUseBalloon.Dispose();
            m_firstUseBalloon = null;

            this.checkBox_savePasswordShort.BackColor = SystemColors.Control;
            this.checkBox_savePasswordShort.ForeColor = SystemColors.ControlText;
            this.checkBox_savePasswordShort.Padding   = new Padding(0);
        }
Example #8
0
        public void ShowShortSavePasswordTip()
        {
            m_firstUseBalloon           = new MessageBalloon();
            m_firstUseBalloon.Parent    = this.checkBox_savePasswordShort;
            m_firstUseBalloon.Title     = "小技巧";
            m_firstUseBalloon.TitleIcon = TooltipIcon.Info;
            m_firstUseBalloon.Text      = "勾选 “短期保存密码” 项,可以让内务前端在运行期间记住您用过的密码,不再反复出现本对话框";

            m_firstUseBalloon.Align                  = BalloonAlignment.BottomRight;
            m_firstUseBalloon.CenterStem             = false;
            m_firstUseBalloon.UseAbsolutePositioning = false;
            m_firstUseBalloon.Show();

            this.checkBox_savePasswordShort.BackColor = SystemColors.Highlight;
            this.checkBox_savePasswordShort.ForeColor = SystemColors.HighlightText;
            this.checkBox_savePasswordShort.Padding   = new Padding(6);
        }
Example #9
0
        bool m_bBalloonDisplayed = false;   // 是否已经显示过一次了

        /*public*/ void ShowMessageTip()
        {
            if (m_bBalloonDisplayed == true)
            {
                return;
            }

            m_firstUseBalloon           = new MessageBalloon();
            m_firstUseBalloon.Parent    = this.webBrowser1;
            m_firstUseBalloon.Title     = "如何确定 MARC 文件的编码方式?";
            m_firstUseBalloon.TitleIcon = TooltipIcon.Info;
            m_firstUseBalloon.Text      = "\r\n这里显示了当前文件第一条 MARC 记录的内容,请仔细观察汉字内容部分是否正确。\r\n\r\n如果出现了乱码,可重选其他编码方式试试";

            m_firstUseBalloon.Align                  = BalloonAlignment.BottomRight;
            m_firstUseBalloon.CenterStem             = false;
            m_firstUseBalloon.UseAbsolutePositioning = false;
            m_firstUseBalloon.Show();

            m_bBalloonDisplayed = true;
        }
Example #10
0
        /// <summary>
        /// When the mouse hovers display the balooon tool tip
        /// </summary>
        private void Map_MouseHover(object sender, EventArgs e)
        {
            if (m_Balloon == null)
            {
                System.Drawing.Point location = Pandora.Map.PointToClient(System.Windows.Forms.Control.MousePosition);

                IMapDrawable obj = Pandora.Map.FindDrawObject(location, 5);

                if (obj != null && obj is SpawnDrawObject)
                {
                    SpawnDrawObject spawn = obj as SpawnDrawObject;

                    m_Balloon = MessageBalloon.Show(spawn.Spawn.ToolTipDetailed, Pandora.TextProvider["Travel.SpawnDetails"],
                                                    null,
                                                    MessageBalloonOptions.All,
                                                    MessageBalloon.MousePosition);
                    m_Balloon.VisibleChanged += new EventHandler(m_Balloon_VisibleChanged);
                }
            }
        }
Example #11
0
 private void ShowBalloonHelp()
 {
     if (ApplicationOptions.Instance.ShowBalloonHelp)
     {
         messageBalloon           = new MessageBalloon(windowFinder);
         messageBalloon.Align     = BalloonAlignment.BottomMiddle;
         messageBalloon.TitleIcon = TooltipIcon.Info;
         if (!CoreApplicationOptions.Instance.IsInjected)
         {
             messageBalloon.Title = "Drag & Drop me on any .Net Control!";
             messageBalloon.Text  = "Hawkeye: Aim. Zoom. Reveal!\r\n\r\nTo start editing .Net objects Drag and Drop the target on ANY .Net Control in ANY .Net process.";
         }
         else
         {
             messageBalloon.Title = "I just attached to: " + Application.ProductName;
             messageBalloon.Text  = "You can now start editing any object from this process. You can even attach me to another process. Just Drag & Drop me to another .Net Control!";
         }
         messageBalloon.Show();
     }
 }
Example #12
0
		/// <summary>
		/// When the mouse hovers display the balooon tool tip
		/// </summary>
		private void Map_MouseHover(object sender, EventArgs e)
		{
			if ( m_Balloon == null )
			{
				System.Drawing.Point location = Pandora.Map.PointToClient( System.Windows.Forms.Control.MousePosition );

				IMapDrawable obj = Pandora.Map.FindDrawObject( location, 5 );

				if ( obj != null && obj is SpawnDrawObject )
				{
					SpawnDrawObject spawn = obj as SpawnDrawObject;

					m_Balloon = MessageBalloon.Show( spawn.Spawn.ToolTipDetailed, Pandora.TextProvider[ "Travel.SpawnDetails" ],
						null,
						MessageBalloonOptions.All,
						MessageBalloon.MousePosition,
						Pandora.BoxForm );
					m_Balloon.VisibleChanged += new EventHandler(m_Balloon_VisibleChanged);
				}
			}
		}