Пример #1
0
        Gdk.Rectangle GetScreenRect()
        {
            int ox, oy;

            ParentWindow.GetOrigin(out ox, out oy);
            var alloc = notebook.Allocation;

            alloc.X += ox;
            alloc.Y += oy;
            return(alloc);
        }
Пример #2
0
 public override void CursorMoveLeft()
 {
     if (CursorPostion != 0)
     {
         CursorPostion--;
         Draw();
     }
     else
     {
         ParentWindow.MovetoNextItemLeft(Xpostion - 1, Ypostion, 3);
     }
 }
Пример #3
0
 public override void CursorMoveRight()
 {
     if (CursorPostion != Text.Length)
     {
         CursorPostion++;
         Draw();
     }
     else
     {
         ParentWindow.MovetoNextItemRight(Xpostion - 1, Ypostion + Width, 3);
     }
 }
Пример #4
0
 private void Client_Unloaded(object sender, RoutedEventArgs e)
 {
     try
     {
         ClearBluetoothLEDevice();
         datas = null;
     }
     catch
     {
         ParentWindow.NotifyUser("错误: 无法重置软件状态", MainWindow.NotifyType.ErrorMessage);
     }
 }
Пример #5
0
 public override void CursorMoveLeft()
 {
     if (CursorPostion != 0)
     {
         CursorPostion--;
         Draw();
     }
     else
     {
         ParentWindow.MovetoNextControlLeft();
     }
 }
Пример #6
0
 public override void CursorMoveRight()
 {
     if (CursorPostion != Text.Length)
     {
         CursorPostion++;
         Draw();
     }
     else
     {
         ParentWindow.MovetoNextControlRight();
     }
 }
Пример #7
0
        /// <summary>
        /// Called when player input has been detected and an appropriate response needs to be determined.
        /// </summary>
        public override void OnInputBufferReturned(string input)
        {
            // Skip if there are days to skip.
            if (UserData.DaysToSkip > 0)
            {
                return;
            }

            // Return to normal after the time skip.
            UserData.DaysToSkip = 0;
            ParentWindow.RemoveWindowNextTick();
        }
Пример #8
0
 private void Widget_MouseLeave(object sender, MouseEventArgs e)
 {
     if (!_closeThread.IsAlive)
     {
         _closeThread = new Thread(WaitForClose)
         {
             IsBackground = true
         };
         _closeThread.Start();
     }
     ParentWindow.Focus();
 }
Пример #9
0
 public void RemoveSelf()
 {
     if (ParentWindow != null)
     {
         ParentWindow.RemoveSelf(this);
     }
     else if (ParentDockPane != null)
     {
         ParentDockPane.RemoveDockPane(this);
         ArrangeGrid(ParentDockPane);
     }
 }
Пример #10
0
 public void ShowChildWindow(IParentWindow parentWindow = null)
 {
     if (parentWindow != null)
     {
         ParentWindow = parentWindow;
     }
     if (ParentWindow != null)
     {
         ParentWindow.RegisterChildWindow(this);
     }
     Show();
 }
Пример #11
0
 public override void CursorMoveUp()
 {
     if (CursorX != 0)
     {
         CursorX--;
         Draw();
     }
     else
     {
         ParentWindow.MovetoNextItemUp(Xpostion, Ypostion, Width);
     }
 }
        /// <summary>
        ///     OK clicked.
        /// </summary>
        private void Ok( )
        {
            foreach (Section section in SectionsView.View)
            {
                foreach (Entry entry in section.EntriesView.View)
                {
                    entry.Plugin.Plugin.SaveOptions( );
                }
            }

            ParentWindow.Close( );
        }
        string AskForEncryptionPassword(string server)
        {
            EncryptionConfigurationDialogData dialogData =
                EncryptionConfigurationDialog.RequestEncryptionPassword(server, ParentWindow.Get());

            if (!dialogData.Result)
            {
                return(null);
            }

            return(dialogData.EncryptedPassword);
        }
Пример #14
0
 override public void CursorMoveUp()
 {
     if (CursorX != 0)
     {
         CursorX--;
         Draw();
     }
     else
     {
         ParentWindow.MovetoNextControlUp(X, Y, Width);
     }
 }
Пример #15
0
        /// <summary>Fired when the game Windows current state is not null and input buffer does not match any known command.</summary>
        /// <param name="input">Contents of the input buffer which didn't match any known command in parent game Windows.</param>
        public override void OnInputBufferReturned(string input)
        {
            // Skip if we have not actually skipped any days yet.
            if (UserData.DaysToSkip > 0)
            {
                return;
            }

            // After the event skips some days we will want to return to what were doing
            UserData.DaysToSkip = 0;
            ParentWindow.RemoveWindowNextTick();
        }
Пример #16
0
        AskCredentialsToUser.DialogData AskCredentialsToUser.IGui.AskUserForCredentials(string servername)
        {
            AskCredentialsToUser.DialogData result = null;

            GUIActionRunner.RunGUIAction(delegate
            {
                result = CredentialsDialog.RequestCredentials(
                    servername, ParentWindow.Get());
            });

            return(result);
        }
        private async void PART_Stepper_CancelNavigation(object sender, MaterialDesignExtensions.Controls.StepperNavigationEventArgs args)
        {
            // 发送撤销请求的包
            await NetworkHelper.GetAsync(new CancelApplicationRequest()
            {
                ApplicationId = ApplicationViewModel.OriginalItem.ID
            })
            .Progress(ParentWindow.PART_ProgressBar);

            MainWindow.SetSnackBarContentAndPopup("申请已取消");
            ParentWindow.NavigateToMainPage();
        }
Пример #18
0
        private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selTab = e.AddedItems[0] as TabItem;

            if (selTab == personalInfoTab)
            {
                ParentWindow.RunAsynchronousOperation(delegate
                {
                    usrProfilePersonalInfo1.Fill(profile);
                }, UIHelper.FindVisualParent <ProfileEditWindow>(this).UpdateProgressIndicator);
            }
        }
Пример #19
0
        public void HandleScreenState(KeyboardState keyboard)
        {
            bool toggleFullscreen = keyboard.IsKeyDown(OpenTK.Input.Key.F11) ||
                                    ((keyboard.IsKeyDown(OpenTK.Input.Key.AltLeft) ||
                                      keyboard.IsKeyDown(OpenTK.Input.Key.AltRight)) &&
                                     keyboard.IsKeyDown(OpenTK.Input.Key.Enter)) ||
                                    keyboard.IsKeyDown(OpenTK.Input.Key.Escape);

            bool fullScreenToggled = ParentWindow.State.HasFlag(Gdk.WindowState.Fullscreen);

            if (toggleFullscreen != _toggleFullscreen)
            {
                if (toggleFullscreen)
                {
                    if (fullScreenToggled)
                    {
                        ParentWindow.Unfullscreen();
                        (Toplevel as MainWindow)?.ToggleExtraWidgets(true);
                    }
                    else
                    {
                        if (keyboard.IsKeyDown(OpenTK.Input.Key.Escape))
                        {
                            if (GtkDialog.CreateExitDialog())
                            {
                                Exit();
                            }
                        }
                        else
                        {
                            ParentWindow.Fullscreen();
                            (Toplevel as MainWindow)?.ToggleExtraWidgets(false);
                        }
                    }
                }
            }

            _toggleFullscreen = toggleFullscreen;

            bool toggleDockedMode = keyboard.IsKeyDown(OpenTK.Input.Key.F9);

            if (toggleDockedMode != _toggleDockedMode)
            {
                if (toggleDockedMode)
                {
                    ConfigurationState.Instance.System.EnableDockedMode.Value =
                        !ConfigurationState.Instance.System.EnableDockedMode.Value;
                }
            }

            _toggleDockedMode = toggleDockedMode;
        }
Пример #20
0
        private void WriteToFile(string filepath)
        {
            RadioButton[,] radioButtons = new RadioButton[3, 3] {
                { rbLL1, rbRL1, rbMI1 }, { rbLL2, rbRL2, rbMI2 }, { rbLL3, rbRL3, rbMI3 }
            };
            string[] position = new string[3];

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (radioButtons[i, j].IsChecked == true)
                    {
                        position[i] = radioButtons[i, j].Content.ToString();
                    }
                }
            }


            try
            {
                for (int i = 0; i < datas.Length; i++)
                {
                    if (i < ParentWindow.SelectedBleDeviceId.Count)
                    {
                        DirectoryInfo fileDir  = new DirectoryInfo(filepath);
                        var           fileName = filepath + $"\\{tbName.Text}-{position[i]}-{ParentWindow.SelectedBleDeviceName[i]}-{i + 1}.csv";
                        int           fp       = 0;
                        while (System.IO.File.Exists(fileName))
                        {
                            fileName = filepath + $"\\{tbName.Text}-{position[i]}-{ParentWindow.SelectedBleDeviceName[i]}-{i + 1}({fp++}).csv";
                        }

                        var fs = new FileStream(fileName, FileMode.CreateNew);
                        using (StreamWriter writer = new StreamWriter(fs, Encoding.UTF8))
                        {
                            writer.WriteLine("time" + "," + "value");
                            foreach (var dt in datas[i])
                            {
                                writer.WriteLine(dt.dateTime.ToString("hh:mm:ss.fff") + "," + dt.value);
                            }
                        }
                    }
                }
                ParentWindow.NotifyUser("文件保存成功.", MainWindow.NotifyType.StatusMessage);
            }

            catch (Exception ex)
            {
                ParentWindow.NotifyUser("文件保存错误:" + ex.ToString(), MainWindow.NotifyType.ErrorMessage);
            }
        }
Пример #21
0
 public void Fill()
 {
     IsInProgress = true;
     ParentWindow.RunAsynchronousOperation(delegate
     {
         CustomerGroupsReposidory.Instance.EnsureLoaded();
         ParentWindow.SynchronizationContext.Send(delegate
         {
             Items        = CustomerGroupsReposidory.Instance.Items.Values;
             IsInProgress = false;
         }, null);
     });
 }
Пример #22
0
        private async void PlaySelectedDefault()
        {
            var map = GetSelectedDefault();

            if (map == null)
            {
                return;
            }
            await ParentWindow.PlayNewFile(Path.Combine(Domain.OsuSongPath, map.FolderName,
                                                        map.BeatmapFileName));

            InstanceManage.GetInstance <PlayerList>().RefreshPlayListAsync(PlayerList.FreshType.All, PlayListMode.RecentList);
        }
Пример #23
0
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (r2.IsChecked == true)
     {
         StartVial[CIndex] = 1;
     }
     else
     {
         StartVial[CIndex] = 0;
     }
     ParentWindow.IsEnabled = true;
     ParentWindow.Show();
 }
Пример #24
0
        /***
         * protected override void OnKeyDown (KeyboardKeyEventArgs e)
         * {
         *      switch (e.Key) {
         *      case Key.Escape:
         *              OnCancel ();
         *              break;
         *      case Key.Enter:
         *              OnOK ();
         *              break;
         *      default:
         *              base.OnKeyDown (e);
         *              break;
         *      }
         * }
         ****/

        public void Show(SummerGUIWindow parent)
        {
            if (ParentWindow != parent)
            {
                this.LogWarning("Parent should equal ParentWindow");
            }

            if (ParentWindow != null)
            {
                ParentWindow.AddChildWindow(this);
            }
            this.Run();
        }
Пример #25
0
        public void RemovePage(object page)
        {
            if (InternalChildren.Remove(page))
            {
                if (FormsContentControl != null)
                {
                    FormsContentControl.Transition = TransitionType.Normal;
                }
                CurrentPage = InternalChildren.Last();
            }

            ParentWindow?.SynchronizeAppBar();
        }
Пример #26
0
 private async void DeviceWatcher_Stopped(DeviceWatcher sender, object e)
 {
     // We must update the collection on the UI thread because the collection is databound to a UI element.
     await Dispatcher.InvokeAsync(() =>
     {
         // Protect against race condition if the task runs after the app stopped the deviceWatcher.
         if (sender == deviceWatcher)
         {
             ParentWindow.NotifyUser($"停止查找设备.",
                                     sender.Status == DeviceWatcherStatus.Aborted ? MainWindow.NotifyType.ErrorMessage : MainWindow.NotifyType.StatusMessage);
         }
     });
 }
Пример #27
0
 private async void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, object e)
 {
     // We must update the collection on the UI thread because the collection is databound to a UI element.
     await Dispatcher.InvokeAsync(() =>
     {
         // Protect against race condition if the task runs after the app stopped the deviceWatcher.
         if (sender == deviceWatcher)
         {
             ParentWindow.NotifyUser($"已发现{KnownDevices.Count} 设备. 扫描完成.",
                                     MainWindow.NotifyType.StatusMessage);
         }
     });
 }
Пример #28
0
        /// <summary>
        /// 取消加密操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            //加密取消,可重复调用
            if (smfCipher != null)
            {
                smfCipher.Cancel();
            }

            //取消后跳转至加密起始页面
            Button obj = sender as Button;

            ParentWindow.NavigateEncrypt(obj.Tag.ToString());
        }
Пример #29
0
        /// <summary>
        ///     Fired when the dialog receives favorable input and determines a response based on this. From this method it is
        ///     common to attach another state, or remove the current state based on the response.
        /// </summary>
        /// <param name="reponse">The response the dialog parsed from simulation input buffer.</param>
        protected override void OnDialogResponse(DialogResponse reponse)
        {
            // Determine if we are showing the player a tombstone because they died.
            if (GameSimulationApp.Instance.Vehicle.PassengerLivingCount <= 0)
            {
                // Completely resets the game to default state it was in when it first started.
                UserData.ClearTombstone();
                GameSimulationApp.Instance.Restart();
                return;
            }

            // Return to travel mode menu if we are just looking at some other dead guy grave.
            ParentWindow.RemoveWindowNextTick();
        }
Пример #30
0
        public void DoRenamePlaylist(object sender, RoutedEventArgs args)
        {
            PlayList pl = PlaylistListBox.SelectedItems[0] as PlayList;
            SingleStringInputDialog ssid = new SingleStringInputDialog("Enter a new Playlist name", "Rename playlist");

            ssid.ShowDialog();
            if (ssid.DialogResult ?? false)
            {
                pl.Name = ssid.InputValue;
                //var plList = PlaylistListBox.ItemsSource as ObservableCollection<PlayList>;
                ParentWindow.UpdateLists();
                ParentWindow.AsyncSerialize(ParentWindow.BackgroundCallback);
            }
        }