public static void Toast(string message = "Something terrible may have just happened and you are being notified of it.",
         ToasterPosition position = ToasterPosition.PrimaryScreenBottomRight,ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
         double margin = 10.0)
 {
     var err = new WarningToaster(message, position, animation, margin);
     err.Show();
 }
 public static void Toast(string messageAutor = "", string messageTheme="[Без темы]",
     ToasterPosition position = ToasterPosition.PrimaryScreenTopRight, ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
     double margin = 10.0)
 {
     var err = new SuccessToaster(messageAutor, messageTheme, position, animation, margin);
     err.Show();
 }
 public static void Toast(netoaster.Message _myMes1, netoaster.Message _myMes2, string messageEmail1 = "A", string messageAutor1 = "", string messageTheme1 = "[Без темы]", string messageEmail2 = "A", string messageAutor2 = "", string messageTheme2 = "[Без темы]", int timeActive = 3, 
         ToasterPosition position = ToasterPosition.PrimaryScreenBottomRight,ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
         double margin = 10.0)
 {
     var err = new WarningToaster(_myMes1, _myMes2, messageEmail1, messageAutor1, messageTheme1, messageEmail2, messageAutor2, messageTheme2, timeActive, position, animation, margin);
     err.Show();
 }
예제 #4
0
        private static ToasterWindow GetToasterWindow(FrameworkElement owner, ToastType type, string title, string message,
                                                      ToasterPosition position, ToasterAnimation animation, double margin)
        {
            var toaster = new ToasterWindow(owner, title, message, position, animation, margin);

            switch (type)
            {
            case ToastType.Error:
                toaster.Ico.Data = NotificationIcoPath.Error;
                toaster.Notification.Background = NotificationColor.Error;
                break;

            case ToastType.Info:
                toaster.Ico.Data = NotificationIcoPath.Info;
                toaster.Notification.Background = NotificationColor.Info;
                break;

            case ToastType.Warning:
                toaster.Ico.Data = NotificationIcoPath.Warning;
                toaster.Notification.Background = NotificationColor.Warning;
                break;

            case ToastType.Success:
                toaster.Ico.Data = NotificationIcoPath.Success;
                toaster.Notification.Background = NotificationColor.Success;
                break;
            }
            return(toaster);
        }
예제 #5
0
        public ToasterWindow(FrameworkElement owner, string title, string message,
                             ToasterPosition position, ToasterAnimation animation, double margin)
        {
            InitializeComponent();
            ToasterTitle = title;
            Message      = message;
            Position     = position;
            Animation    = animation;
            Margins      = margin;

            var story = ToastSupport.GetAnimation(Animation, Notification);

            story.Completed += (sender, args) => { Close(); };
            story.Begin(Notification);

            Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(() =>
            {
                var topLeftDict = ToastSupport.GetTopandLeft(Position, this, Margins);
                Top             = topLeftDict["Top"];
                Left            = topLeftDict["Left"];
            }));

            if (owner != null)
            {
                owner.Unloaded += Owner_Unloaded;
            }
        }
    private WarningToaster(string messageEmail1, string messageAutor1, string messageTheme1, string messageEmail2, string messageAutor2, string messageTheme2, int timeActive , ToasterPosition position, ToasterAnimation animation, double margin)
  {
    InitializeComponent();

    Brush[] brushes = new Brush[] {
            new SolidColorBrush(Color.FromArgb(0xFF, 0x2D, 0x1E, 0x4B)),
            new SolidColorBrush(Color.FromArgb(0xFF, 0x7B, 0x25, 0xFA)),
            new SolidColorBrush(Color.FromArgb(0xFF, 0x71, 0x9F, 0x3F))
        };
    Random rnd = new Random();
    avatar1.Fill = brushes[rnd.Next(brushes.Length)];
    avatar2.Fill = brushes[rnd.Next(brushes.Length)];

    var msgAutor1 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("autorname1");
    if (msgAutor1 != null) msgAutor1.Text = messageAutor1 ?? string.Empty;
    var msgTheme1 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("themetext1");
    if (messageTheme1.Length >= 28)
    {
        if (msgTheme1 != null) msgTheme1.Text = messageTheme1.Substring(0, 27) + "..." ?? string.Empty;
    }
    else
    {
        if (msgTheme1 != null) msgTheme1.Text = messageTheme1 ?? string.Empty;
    }
    var msgEmail1 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("emailtext1");
    if (msgEmail1 != null) msgEmail1.Text = messageEmail1 ?? string.Empty;
    var msgName1 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("autorletter1");
    if (msgName1 != null) msgName1.Text = messageEmail1.Substring(0, 1).ToUpper() ?? string.Empty;

    var msgAutor2 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("autorname2");
    if (msgAutor2 != null) msgAutor2.Text = messageAutor2 ?? string.Empty;
    var msgTheme2 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("themetext2");
    if (messageTheme2.Length >= 28)
    {
        if (msgTheme2 != null) msgTheme2.Text = messageTheme2.Substring(0, 27) + "..." ?? string.Empty;
    }
    else
    {
        if (msgTheme1 != null) msgTheme2.Text = messageTheme2 ?? string.Empty;
    }
    var msgEmail2 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("emailtext2");
    if (msgEmail2 != null) msgEmail2.Text = messageEmail2 ?? string.Empty;
    var msgName2 = (System.Windows.Documents.Run)WarningToasterInstance.FindName("autorletter2");
    if (msgName2 != null) msgName2.Text = messageEmail2.Substring(0, 1).ToUpper() ?? string.Empty;

    Storyboard story = ToastSupport.GetAnimation(animation, ref WarningToasterInstance, timeActive);
    story.Completed += (sender, args) => { this.Close(); };
    story.Begin(WarningToasterInstance);

    Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(() =>
    {
        var topLeftDict = ToastSupport.GetTopandLeft(position, this, margin);
        Top = topLeftDict["Top"];
        Left = topLeftDict["Left"];
    }));
  }
예제 #7
0
 public static void Toast(
     Window owner,
     string title = "Info",
     string message = "Something you may notice.",
     ToasterPosition position = ToasterPosition.PrimaryScreenTopRight,
     ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
     double margin = 10.0)
 {
     var toaster = new InfoToaster(owner, title, message, position, animation, margin);
     toaster.Show();
 }
예제 #8
0
 public static void Toast(
     Window owner,
     string title = "Success",
     string message = "All good.",
     ToasterPosition position = ToasterPosition.PrimaryScreenTopRight,
     ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
     double margin = 10.0)
 {
     var toaster = new SuccessToaster(owner, title, message, position, animation, margin);
     toaster.Show();
 }
예제 #9
0
 public static void Toast(
     Window owner,
     string title = "Error",
     string message = "Something terrible may have just happened and you are being notified of it.",
     ToasterPosition position = ToasterPosition.PrimaryScreenBottomRight,
     ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
     double margin = 10.0)
 {
     var toaster = new ErrorToaster(owner, title, message, position, animation, margin);
     toaster.Show();
 }
예제 #10
0
        public static void ShowSuccess(
            Window owner,
            string title               = "Success",
            string message             = "All good.",
            ToasterPosition position   = ToasterPosition.PrimaryScreenBottomRight,
            ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
            double margin              = 10.0)
        {
            var toaster = GetToasterWindow(owner, ToastType.Success, title, message, position, animation, margin);

            toaster.Show();
        }
예제 #11
0
        public static void Toast(
            Window owner,
            string title               = "Success",
            string message             = "All good.",
            ToasterPosition position   = ToasterPosition.PrimaryScreenTopRight,
            ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
            double margin              = 10.0)
        {
            var toaster = new SuccessToaster(owner, title, message, position, animation, margin);

            toaster.Show();
        }
예제 #12
0
        public static void Toast(
            Window owner,
            string title               = "Info",
            string message             = "Something you may notice.",
            ToasterPosition position   = ToasterPosition.PrimaryScreenTopRight,
            ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
            double margin              = 10.0)
        {
            var toaster = new InfoToaster(owner, title, message, position, animation, margin);

            toaster.Show();
        }
예제 #13
0
        public static void ShowWarning(
            Window owner,
            string title               = "Warning",
            string message             = "Something terrible may have just happened and you are being notified of it.",
            ToasterPosition position   = ToasterPosition.PrimaryScreenBottomRight,
            ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
            double margin              = 10.0)
        {
            var toaster = GetToasterWindow(owner, ToastType.Warning, title, message, position, animation, margin);

            toaster.Show();
        }
예제 #14
0
        public static void ShowInfo(
            Window owner,
            string title               = "Info",
            string message             = "Something you may notice.",
            ToasterPosition position   = ToasterPosition.ApplicationBottomRight,// .PrimaryScreenBottomRight,
            ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
            double margin              = 10.0)
        {
            var toaster = GetToasterWindow(owner, ToastType.Info, title, message, position, animation, margin);

            toaster.Show();
        }
    private WarningToaster(string message, ToasterPosition position, ToasterAnimation animation, double margin)
  {
    InitializeComponent();

    var msgText = (System.Windows.Documents.Run)WarningToasterInstance.FindName("MessageString");
    if (msgText != null) msgText.Text = message ?? string.Empty;

    Storyboard story = ToastSupport.GetAnimation(animation, ref WarningToasterInstance);
    story.Completed += (sender, args) => { this.Close(); };
    story.Begin(WarningToasterInstance);

    Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(() =>
    {
        var topLeftDict = ToastSupport.GetTopandLeft(position, this, margin);
        Top = topLeftDict["Top"];
        Left = topLeftDict["Left"];
    }));
  }
예제 #16
0
        private SuccessToaster(FrameworkElement owner, string title, string message, ToasterPosition position, ToasterAnimation animation, double margin)
        {
            InitializeComponent();

            ToasterTitle = title;
            Message = message ?? string.Empty;

            var story = ToastSupport.GetAnimation(animation, ref SuccessToasterInstance);
            story.Completed += (sender, args) => { this.Close(); };
            story.Begin(SuccessToasterInstance);

            Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(() =>
            {
                var topLeftDict = ToastSupport.GetTopandLeft(position, this, margin);
                Top = topLeftDict["Top"];
                Left = topLeftDict["Left"];
            }));
            owner.Unloaded += Owner_Unloaded;
        }
예제 #17
0
        private SuccessToaster(FrameworkElement owner, string title, string message, ToasterPosition position, ToasterAnimation animation, double margin)
        {
            InitializeComponent();

            ToasterTitle = title;
            Message      = message ?? string.Empty;

            var story = ToastSupport.GetAnimation(animation, ref SuccessToasterInstance);

            story.Completed += (sender, args) => { this.Close(); };
            story.Begin(SuccessToasterInstance);

            Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(() =>
            {
                var topLeftDict = ToastSupport.GetTopandLeft(position, this, margin);
                Top             = topLeftDict["Top"];
                Left            = topLeftDict["Left"];
            }));
            owner.Unloaded += Owner_Unloaded;
        }
    private SuccessToaster(string messageAutor,string messageTheme, ToasterPosition position, ToasterAnimation animation, double margin)
    {
        InitializeComponent();

        var msgAutor = (System.Windows.Documents.Run)SuccessToasterInstance.FindName("autorname");
        if (msgAutor != null) msgAutor.Text = messageAutor ?? string.Empty;
        var msgTheme = (System.Windows.Documents.Run)SuccessToasterInstance.FindName("themetext");
        if (msgTheme != null) msgTheme.Text = messageTheme ?? string.Empty;
        var msgName = (System.Windows.Documents.Run)SuccessToasterInstance.FindName("name");
        if (msgName != null) msgName.Text = messageAutor.Substring(0,1) ?? string.Empty;

        Storyboard story = ToastSupport.GetAnimation(animation, ref SuccessToasterInstance);
        story.Completed += (sender, args) => { this.Close(); };
        story.Begin(SuccessToasterInstance);

        Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(() =>
        {
            var topLeftDict = ToastSupport.GetTopandLeft(position, this, margin);
            Top = topLeftDict["Top"];
            Left = topLeftDict["Left"];
        }));
    }
예제 #19
0
        private ErrorToaster(string message, string title, ToasterPosition position, ToasterAnimation animation, double margin)
        {
            this.InitializeComponent();
            System.Windows.Documents.Run run = (System.Windows.Documents.Run) this.ErrorToasterInstance.FindName("MessageString");
            if (run != null)
            {
                run.Text = message ?? string.Empty;
            }
            System.Windows.Documents.Run run2 = (System.Windows.Documents.Run) this.ErrorToasterInstance.FindName("TitleString");
            if (run2 != null)
            {
                run2.Text = title ?? string.Empty;
            }
            Storyboard storyboard = ToastSupport.GetAnimation(animation, ref this.ErrorToasterInstance);

            storyboard.Completed += (sender, args) => base.Close();
            storyboard.Begin(this.ErrorToasterInstance);
            base.Dispatcher.BeginInvoke(DispatcherPriority.DataBind, (Action) delegate
            {
                Dictionary <string, double> dictionary = ToastSupport.GetTopandLeft(position, this, margin);
                this.Top  = dictionary["Top"];
                this.Left = dictionary["Left"];
            });
        }
    private ErrorToaster(netoaster.Message myMessage1, netoaster.Message myMessage2, netoaster.Message myMessage3, string messageEmail1, string messageAutor1, string messageTheme1, string messageEmail2, string messageAutor2, string messageTheme2, string messageEmail3, string messageAutor3, string messageTheme3, int timeActive, int countNewMessage, ToasterPosition position, ToasterAnimation animation, double margin)
    {
        InitializeComponent();

        Brush[] brushes = new Brush[] {
            new SolidColorBrush(Color.FromArgb(0xFF, 0x2D, 0x1E, 0x4B)),
            new SolidColorBrush(Color.FromArgb(0xFF, 0x7B, 0x25, 0xFA)),
            new SolidColorBrush(Color.FromArgb(0xFF, 0x71, 0x9F, 0x3F))
        };
        Random rnd = new Random();
        avatar1.Fill = brushes[rnd.Next(brushes.Length)];
        avatar2.Fill = brushes[rnd.Next(brushes.Length)];
        avatar3.Fill = brushes[rnd.Next(brushes.Length)];

        email=myMessage1.emailUser;
        if (!(myMessage1.emailUser.Length > "summerintensiveemailcheckertest".Length))
        {
            EmailTo.Text = "Пришло на адрес: " + myMessage1.emailUser;
        }
        else
        {
            EmailTo.Text = "Пришло на адрес: " + myMessage1.emailUser.Remove("summerintensiveemailcheckertest".Length - 3) + "...";
        }

        var msgAutor1 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("autorname1");
        if (msgAutor1 != null) msgAutor1.Text = messageAutor1 ?? string.Empty;
        var msgTheme1 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("themetext1");
        if (messageTheme1.Length >= 28)
        {
            if (msgTheme1 != null) msgTheme1.Text = messageTheme1.Substring(0, 27) + "..." ?? string.Empty;
        }
        else
        {
            if (msgTheme1 != null) msgTheme1.Text = messageTheme1 ?? string.Empty;
        }
        var msgEmail1 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("emailtext1");
        if (msgEmail1 != null) msgEmail1.Text = messageEmail1 ?? string.Empty;
        var msgName1 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("autorletter1");
        if (msgName1 != null) msgName1.Text = messageEmail1.Substring(0, 1).ToUpper() ?? string.Empty;

        var msgAutor2 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("autorname2");
        if (msgAutor2 != null) msgAutor2.Text = messageAutor2 ?? string.Empty;
        var msgTheme2 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("themetext2");
        if (messageTheme2.Length >= 28)
        {
            if (msgTheme2 != null) msgTheme2.Text = messageTheme2.Substring(0, 27) + "..." ?? string.Empty;
        }
        else
        {
            if (msgTheme1 != null) msgTheme2.Text = messageTheme2 ?? string.Empty;
        }
        var msgEmail2 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("emailtext2");
        if (msgEmail2 != null) msgEmail2.Text = messageEmail2 ?? string.Empty;
        var msgName2 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("autorletter2");
        if (msgName2 != null) msgName2.Text = messageEmail2.Substring(0, 1).ToUpper() ?? string.Empty;

        var msgAutor3 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("autorname3");
        if (msgAutor3 != null) msgAutor3.Text = messageAutor3 ?? string.Empty;
        var msgTheme3 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("themetext3");
        if (messageTheme3.Length >= 28)
        {
            if (msgTheme3 != null) msgTheme3.Text = messageTheme3.Substring(0, 27) + "..." ?? string.Empty;
        }
        else
        {
            if (msgTheme3 != null) msgTheme3.Text = messageTheme3 ?? string.Empty;
        }
        var msgEmail3 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("emailtext3");
        if (msgEmail3 != null) msgEmail3.Text = messageEmail3 ?? string.Empty;
        var msgName3 = (System.Windows.Documents.Run)ErrorToasterInstance.FindName("autorletter3");
        if (msgName3 != null) msgName3.Text = messageEmail3.Substring(0, 1).ToUpper() ?? string.Empty;

        if (countNewMessage > 0)
        {
            fullinfo.Content = "Новых писем -" + " " + countNewMessage.ToString();
            fullinfo.Visibility = System.Windows.Visibility.Visible;
            rectang.Visibility = System.Windows.Visibility.Visible;
            this.Height = 252;
            bord.Height = 252;
        }
        else
        {
            fullinfo.Visibility = System.Windows.Visibility.Hidden;
            this.Height = 240;
            bord.Height = 240;
            rectang.Visibility = System.Windows.Visibility.Hidden;

        }

        Storyboard story = ToastSupport.GetAnimation(animation, ref ErrorToasterInstance, timeActive);
        story.Completed += (sender, args) => { this.Close(); };
        story.Begin(ErrorToasterInstance);

        Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(() =>
        {
            var topLeftDict = ToastSupport.GetTopandLeft(position, this, margin);
            Top = topLeftDict["Top"];
            Left = topLeftDict["Left"];
        }));
    }
 public static void Toast(string p, ToasterPosition toasterPosition, ToasterAnimation animation, double margin)
 {
     throw new NotImplementedException();
 }
        public static Dictionary<string, double> GetTopandLeft(ToasterPosition positionSelection, Window windowRef, double margin)
        {
            var retDict = new Dictionary<string, double>();
            Rectangle workingArea;
            Point bottomcorner;
            Point topcorner;

            workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
            
            var currentAppWindow = Application.Current.MainWindow;
            //Get the Currently running applications screen.
            var screen = System.Windows.Forms.Screen.FromHandle(
                new System.Windows.Interop.WindowInteropHelper(currentAppWindow).Handle);
            
            var workingPosition = positionSelection;
            //Application being maximized causes some wonky crap sometimes. 
            //May as well use Primary Screen. 
            if (currentAppWindow.WindowState == WindowState.Maximized)
            {
                switch (positionSelection)
                {
                    case ToasterPosition.ApplicationBottomRight:
                        workingPosition = ToasterPosition.PrimaryScreenBottomRight;
                        break;
                    case ToasterPosition.ApplicationTopRight:
                        workingPosition = ToasterPosition.PrimaryScreenTopRight;
                        break;
                }
            }
            var transform = getTransform(windowRef);
            
            retDict.Add("Left", 0);
            retDict.Add("Top", 0);
            switch (workingPosition)
            {
               
                case ToasterPosition.PrimaryScreenBottomRight:
                    workingArea = screen.WorkingArea;
                    bottomcorner = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                    retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - margin;
                    retDict["Top"] = bottomcorner.Y - windowRef.ActualHeight - margin;
                    break;
              
                case ToasterPosition.PrimaryScreenTopRight:
                    workingArea = screen.WorkingArea;
                    bottomcorner = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                    topcorner = transform.Transform(new Point(workingArea.Right, workingArea.Top));
                    retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - margin;
                    retDict["Top"] = topcorner.Y + margin;
                    break;
             
                default:
                    //ToasterPosition.PrimaryScreenBottomRight
                    workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
                    bottomcorner = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                    topcorner = transform.Transform(new Point(workingArea.Right, workingArea.Top));
                    retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - 100;
                    retDict["Top"] = bottomcorner.Y - windowRef.ActualHeight;
                    break;
            }
            return retDict;

        }
예제 #23
0
 public static void Toast(string message = "Сообщение", string title = "Ошибка", ToasterPosition position = 0, ToasterAnimation animation = ToasterAnimation.FadeIn, double margin = 20.0)
 {
     new ErrorToaster(message, title, position, animation, margin).Show();
 }
 public static void Toast(
    netoaster.Message _myMes1, netoaster.Message _myMes2, netoaster.Message _myMes3, string messageEmail1, string messageAutor1 = "", string messageTheme1 = "", string messageEmail2 = "", string messageAutor2 = "", string messageTheme2 = "", string messageEmail3 = "", string messageAutor3 = "", string messageTheme3 = "", int timeActive = 3, int countNewMessage = 0, ToasterPosition position = ToasterPosition.PrimaryScreenBottomRight, ToasterAnimation animation = ToasterAnimation.SlideInFromRight,
     double margin = 10.0)
 {
     var err = new ErrorToaster(_myMes1, _myMes2, _myMes3, messageEmail1, messageAutor1, messageTheme1, messageEmail2, messageAutor2, messageTheme2, messageEmail3, messageAutor3, messageTheme3, timeActive, countNewMessage, position, animation, margin);
     err.Show();
 }
예제 #25
0
        public static Dictionary <string, double> GetTopandLeft(ToasterPosition positionSelection, Window windowRef,
                                                                double margin)
        {
            var       retDict = new Dictionary <string, double>();
            Rectangle workingArea;
            Point     bottomcorner;
            Point     topcorner;

            workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;

            var currentAppWindow = Application.Current.MainWindow;
            //Get the Currently running applications screen.
            var screen = System.Windows.Forms.Screen.FromHandle(
                new System.Windows.Interop.WindowInteropHelper(currentAppWindow).Handle);

            var workingPosition = positionSelection;

            //Application being maximized causes some wonky crap sometimes.
            //May as well use Primary Screen.
            if (currentAppWindow.WindowState == WindowState.Maximized)
            {
                switch (positionSelection)
                {
                case ToasterPosition.ApplicationBottomRight:
                    workingPosition = ToasterPosition.PrimaryScreenBottomRight;
                    break;

                case ToasterPosition.ApplicationBottomLeft:
                    workingPosition = ToasterPosition.PrimaryScreenBottomLeft;
                    break;

                case ToasterPosition.ApplicationTopLeft:
                    workingPosition = ToasterPosition.PrimaryScreenTopLeft;
                    break;

                case ToasterPosition.ApplicationTopRight:
                    workingPosition = ToasterPosition.PrimaryScreenTopRight;
                    break;
                }
            }
            var transform = GetTransform(windowRef);

            retDict.Add("Left", 0);
            retDict.Add("Top", 0);
            switch (workingPosition)
            {
            case ToasterPosition.PrimaryScreenBottomLeft:
                workingArea     = screen.WorkingArea;
                bottomcorner    = transform.Transform(new Point(workingArea.Left, workingArea.Bottom));
                retDict["Left"] = bottomcorner.X + margin;
                retDict["Top"]  = bottomcorner.Y - windowRef.ActualHeight - margin;
                break;

            case ToasterPosition.PrimaryScreenBottomRight:
                workingArea     = screen.WorkingArea;
                bottomcorner    = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - margin;
                retDict["Top"]  = bottomcorner.Y - windowRef.ActualHeight - margin;
                break;

            case ToasterPosition.PrimaryScreenTopLeft:
                workingArea     = screen.WorkingArea;
                topcorner       = transform.Transform(new Point(workingArea.Right, workingArea.Top));
                retDict["Left"] = margin;
                retDict["Top"]  = topcorner.Y + margin;
                break;

            case ToasterPosition.PrimaryScreenTopRight:
                workingArea     = screen.WorkingArea;
                bottomcorner    = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                topcorner       = transform.Transform(new Point(workingArea.Right, workingArea.Top));
                retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - margin;
                retDict["Top"]  = topcorner.Y + margin;
                break;

            case ToasterPosition.ApplicationBottomRight:
                workingArea = new Rectangle
                              (
                    (int)currentAppWindow.Left, (int)currentAppWindow.Top,
                    (int)currentAppWindow.ActualWidth, (int)currentAppWindow.ActualHeight
                              );

                bottomcorner    = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - 5;
                retDict["Top"]  = bottomcorner.Y - windowRef.ActualHeight;
                break;

            case ToasterPosition.ApplicationBottomLeft:
                workingArea = new Rectangle
                              (
                    (int)currentAppWindow.Left, (int)currentAppWindow.Top,
                    (int)currentAppWindow.ActualWidth, (int)currentAppWindow.ActualHeight
                              );
                bottomcorner    = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                retDict["Left"] = currentAppWindow.Left + 5;
                retDict["Top"]  = bottomcorner.Y - windowRef.ActualHeight;
                break;

            case ToasterPosition.ApplicationTopLeft:
                workingArea = new Rectangle
                              (
                    (int)currentAppWindow.Left, (int)currentAppWindow.Top,
                    (int)currentAppWindow.ActualWidth, (int)currentAppWindow.ActualHeight
                              );
                bottomcorner    = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                topcorner       = transform.Transform(new Point(workingArea.Right, workingArea.Top));
                retDict["Left"] = currentAppWindow.Left;
                retDict["Top"]  = topcorner.Y + 25;
                break;

            case ToasterPosition.ApplicationTopRight:
                workingArea = new Rectangle
                              (
                    (int)currentAppWindow.Left, (int)currentAppWindow.Top,
                    (int)currentAppWindow.ActualWidth, (int)currentAppWindow.ActualHeight
                              );
                bottomcorner    = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                topcorner       = transform.Transform(new Point(workingArea.Right, workingArea.Top));
                retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - 5;
                retDict["Top"]  = topcorner.Y + 25;
                break;

            default:
                //ToasterPosition.PrimaryScreenBottomRight
                workingArea     = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
                bottomcorner    = transform.Transform(new Point(workingArea.Right, workingArea.Bottom));
                topcorner       = transform.Transform(new Point(workingArea.Right, workingArea.Top));
                retDict["Left"] = bottomcorner.X - windowRef.ActualWidth - 100;
                retDict["Top"]  = bottomcorner.Y - windowRef.ActualHeight;
                break;
            }

            return(retDict);
        }