示例#1
0
 /// <summary>
 /// Tell windowHelper to display the notification
 /// </summary>
 /// <param name="helpString">The string to be displayed in the notifiation window</param>
 /// <param name="time">The duration for which the notification window should be active</param>
 /// <param name="windowPosition">The position for which the notification window should be placed</param>
 public void Show(string helpString, int time, HelperWindow.windowStartPosition windowPosition)
 {
     if (true == helperWindowIsOn())
     {
         windowHelper.SetSettings(helpString, time, windowPosition);
         if (windowHelper.Visibility != Visibility.Visible)
         {
             windowHelper.Visibility = Visibility.Visible;
             windowHelper.FormFade.Begin();
         }
     }
 }
示例#2
0
        /// <summary>
        /// Tell windowHelper to display the notification
        /// </summary>
        /// <param name="helpString">The string to be displayed in the notifiation window</param>
        /// <param name="priority">The piority of the window to be displayed</param>
        /// <param name="windowPosition">The position for which the notification window should be placed</param>
        public void Show(string helpString, int priority, HelperWindow.windowStartPosition windowPosition)
        {
            if (priority == -2)
            {
                windowHelper.MainWindow = mainWindow;
                string extraHelpString = "Click here to quit nsync.";
                windowHelper.SetSettings(helpString, -1, windowPosition, "QUIT_NSYNC", extraHelpString);
                windowHelper.ButtonClose.Visibility = Visibility.Hidden;

                if (windowHelper.Visibility != Visibility.Visible && windowHelper.IsLoaded)
                {
                    windowHelper.Visibility = Visibility.Visible;
                    windowHelper.FormFade.Begin(windowHelper);
                }
            }

            else
            {
                if (helperWindowIsOn() || (priority == -1) || (priority == 0))
                {
                    if (priority == -1)
                    {
                        if ((errorCount == 0) && (conflictCount == 0))
                        {
                            windowHelper.SetSettings(helpString, determineTimer(priority), windowPosition, null, null);
                        }
                        else
                        {
                            if (errorCount == 1)
                            {
                                helpString += " " + errorCount + " file not synchronized.";
                            }
                            else
                            {
                                helpString += " " + errorCount + " files not synchronized.";
                            }
                            if (conflictCount == 1)
                            {
                                helpString += " " + conflictCount + " file conflicted.";
                            }
                            else
                            {
                                helpString += " " + conflictCount + " files conflicted.";
                            }
                            string extraHelpString = "Click here to view Log.";
                            windowHelper.SetSettings(helpString, determineTimer(priority), windowPosition, logPath, extraHelpString);
                        }
                    }

                    else
                    {
                        if (isRevertPathDialog)
                        {
                            string extraHelpString = "Click here to revert changes.";
                            windowHelper.HyperTextMouseDown += new System.Windows.Input.MouseButtonEventHandler(windowHelper_HyperTextMouseDown);
                            windowHelper.SetSettings(helpString, determineTimer(priority), windowPosition, null, extraHelpString);
                        }
                        else
                        {
                            windowHelper.SetSettings(helpString, determineTimer(priority), windowPosition, null, null);
                        }
                    }

                    if (windowHelper.Visibility != Visibility.Visible && windowHelper.IsLoaded)
                    {
                        windowHelper.Visibility = Visibility.Visible;
                        windowHelper.FormFade.Begin(windowHelper);
                    }
                }
            }
        }