Esempio n. 1
0
        private static void PositionWindows()
        {
            double top_offset    = 0;
            double left_offset   = 0;
            double window_height = 0;
            bool   is_first      = true;
            var    mainForm      = MainWindow.get_instance();

            foreach (IncomingCallNotification window in windows)
            {
                if (is_first)
                {
                    is_first = false;
                    System.Drawing.Rectangle workingArea = new System.Drawing.Rectangle(DpiUtil.ScaleIntX(mainForm.Left), DpiUtil.ScaleIntY(mainForm.Top), DpiUtil.ScaleIntX(mainForm.ActualWidth), DpiUtil.ScaleIntY(mainForm.ActualHeight));

                    workingArea   = Screen.GetWorkingArea(workingArea);
                    left_offset   = DpiUtil.DeScaleIntX(workingArea.Right) - window.ActualWidth;
                    top_offset    = DpiUtil.DeScaleIntY(workingArea.Bottom) - window.ActualHeight;
                    window_height = window.ActualHeight;
                }
                window.Top = top_offset;

                window.Left = left_offset;
                top_offset -= window_height;
            }
        }
Esempio n. 2
0
        private void CallStateChangedHandler(object sender, Call.CallPropertyEventArgs args)
        {
            if (args.call.state == Call.CALL_STATE.Ringing && !args.call.is_outgoing)
            {
                if (IncomingTopMost)
                {
                    MainWindow.get_instance().BringToFront();
                }
                if (IncomingBalloons && !DND)
                {
                    IncomingCallNotification.ShowCallNotification(args.call);
                    if (Call.active_call != args.call && Call.active_call != null)
                    {
                        HandleCallWaiting(null, args.call);
                    }
                }
                else if (IncomingKeyboardFocus)
                {
                    Utils.SetForegroundWindow(MainWindow.get_instance());
                }
            }
            if (DND && args.call != null && args.call.is_outgoing == false && args.call.state == Call.CALL_STATE.Ringing)
            {
                args.call.hangup("Call ignored due to DND");
            }
            if (args.call != null && args.call.call_ended && ClearDTMFS)
            {
                args.call.dtmfs = "";
            }

            DelayedFunction.DelayedCall("broker_updatestatus", UpdateStatus, 500);
        }
Esempio n. 3
0
 public void BringToFront(BRING_TO_FRONT_OPTS opts)
 {
     if (!opts.HasFlag(BRING_TO_FRONT_OPTS.OnlyIfTopMostSetting) || IncomingTopMost)
     {
         MainWindow.get_instance().BringToFront();
     }
     if (opts.HasFlag(BRING_TO_FRONT_OPTS.AlwaysKeyboardFocus) || (opts.HasFlag(BRING_TO_FRONT_OPTS.KeyboardFocusIfSettingEnabled) && IncomingKeyboardFocus))
     {
         Utils.SetForegroundWindow(MainWindow.get_instance());
     }
 }
Esempio n. 4
0
 public void HangupPressed()
 {
     Application.Current.Dispatcher.BeginInvoke((Action)(() => MainWindow.get_instance().HangupPressed()));
 }
Esempio n. 5
0
 public void MainWindowRemoveFocus(bool ResetContactSearchText = false)
 {
     MainWindow.get_instance().RemoveFocus(ResetContactSearchText);
 }
Esempio n. 6
0
 public OurAutoCompleteBox GetContactSearchBox()
 {
     return(MainWindow.get_instance().GetContactSearchBox());
 }
Esempio n. 7
0
 private static void systray_icon_Click(object sender, EventArgs e)
 {
     MainWindow.get_instance().BringToFront();
 }