Example #1
0
        /// <summary>
        /// FileShareControl�N���X�̐V�����C���X�^���X����������܂�
        /// </summary>
        public FileShareControl()
        {
            InitializeComponent();
            EventInit();

            FileShareService.DebugWrite += new FileShareServiceDebugWriteEventHandler(FileShareService_DebugWrite);

            if (Settings.Default.TreeRadioButton == true)
                QueryGrid.Children.Add(new FileShareTreeQueryControl_2());

            if (Settings.Default.TabRadioButton == true)
                QueryGrid.Children.Add(new FileShareTabQueryControl());

            string chk = "";

            using (SettingWindow settingWindow = new SettingWindow())
            {
                chk = settingWindow.DataFormatCheck();
            }

            if (chk == "")
            {
                StartService();
            }
        }
Example #2
0
        /// <summary>
        /// 設定ウィンドウを開く。
        /// </summary>
        /// <param name="pageId">ページID</param>
        /// <param name="element">親要素</param>
        /// <param name="waitForClose">終了を待機する</param>
        public static void ShowSettingWindow(int?pageId, FrameworkElement?element, bool waitForClose = false)
        {
            var view = App.Instance.Windows
                       .OfType <SettingWindow>()
                       .SingleOrDefault();

            if (view != null)
            {
                view.Activate();
            }
            else
            {
                view = new SettingWindow
                {
                    Owner = element == null ? null : Window.GetWindow(element),
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                };

                view.Show();
            }

            if (pageId.HasValue)
            {
                view.SelectPage(pageId.Value);
            }

            if (waitForClose)
            {
                view.WaitForClose();
            }
        }
Example #3
0
        /// <summary>
        /// Called when [setting handler].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void OnSettingHandler(object sender, RoutedEventArgs e)
        {
            try
            {
                SettingWindow win = null;
                try
                {
                    win       = new SettingWindow();
                    win.Owner = this;
                    win.ShowDialog();
                }
                finally
                {
                    win.Close();
                }
            }
            #region Exception Handling

            catch (Exception ex)
            {
                TraceSourceMonitorHelper.Error("UI event handler failed: {0}", ex);
            }

            #endregion // Exception Handling
        }
Example #4
0
        private void addAuthButton_Click(object sender, RoutedEventArgs e)
        {
            var a = new SettingWindow();

            a.ShowAddAuthModule();
            a.ShowDialog();
            Refresh();
        }
Example #5
0
    public static void OpenSettingTool()
    {
        SettingWindow win = EditorWindow.GetWindow <SettingWindow>();

        win.titleContent.text = "宏设置";
        win.minSize           = new Vector2(635, 200);
        win.maxSize           = new Vector2(635, 630);
        win.Show();
    }
Example #6
0
        private void GotoSetting(object sender, RoutedEventArgs e)
        {
            Test();
            SettingWindow win = new SettingWindow();

            win.Owner = this;
            win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            win.ShowDialog();
        }
Example #7
0
 private void SettingMenu_Click(object sender, RoutedEventArgs e)
 {
     if (_settingWindow == null)
     {
         _settingWindow = new SettingWindow();
         _settingWindow.ShowDialog();
         _settingWindow = null;
     }
 }
Example #8
0
        private void Options()
        {
            SettingWindow settings = new SettingWindow();

            if (settings.ShowDialog() == DialogResult.OK)
            {
                Helper.SaveShortcuts();
            }
        }
Example #9
0
        private void Button_Setting_Click(object sender, RoutedEventArgs e)
        {
            var win = new SettingWindow()
            {
                Owner = Application.Current.MainWindow
            };

            win.ShowDialog();
        }
 /// <summary>
 /// Show the setting window.
 /// </summary>
 private void ShowSettingWindow()
 {
     if (_settingWindow == null)
     {
         _settingWindow         = new SettingWindow();
         _settingWindow.Closed += OnSettingWindowClosed;
     }
     _settingWindow.Show();
 }
Example #11
0
        private void ButtonSetting_Click(object sender, RoutedEventArgs e)
        {
            var setting = new SettingWindow()
            {
                Owner = this, ShowInTaskbar = false, WindowStartupLocation = WindowStartupLocation.CenterOwner
            };

            setting.ShowDialog();
        }
        /// <summary>
        /// open setting window
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OpenSettingWindow(object sender, RoutedEventArgs e)
        {
            var mb = new SettingWindow()
            {
                Width  = 500,
                Height = 320
            };

            mb.Show(this);
        }
Example #13
0
        internal static void OpenSettingDialog(Window ownerWindow)
        {
            var settingWindow = new SettingWindow()
            {
                Owner = ownerWindow
            };

            settingWindow.ShowDialog();
            settingWindow.Dispose();
        }
Example #14
0
    public static void Setting()
    {
        //实例化
        SettingWindow win = (SettingWindow)EditorWindow.GetWindow(typeof(SettingWindow));

        //设置窗口名称
        win.titleContent = new GUIContent("全局设置");
        //窗口显示
        win.Show();
    }
        private void settingBtn_Click(object sender, RoutedEventArgs e)
        {
            var setting = new SettingWindow();

            setting.Closed += (s, ee) =>
            {
                InitializeHotKey();
            };
            setting.Show();
        }
Example #16
0
        public override void In(FlowScriptEngine.FlowEventArgs e)
        {
            SetValue(nameof(Setting));
            var window = new SettingWindow();

            Setting.Initialize();
            window.DataContext = Setting;
            Result             = window.ShowDialog() == true ? DialogResult.OK : DialogResult.Cancel;
            OnSuccess();
        }
        public SettingWindowViewModel(SettingWindow settingWindow)
        {
            this.settingWindow = settingWindow;

            QuestionCollection = new ObservableCollection <question>();
            ButtonClick        = new Command(button_Click, can_button_Click);


            GetQuestion();
        }
 private void InitializeSettingCommand()
 {
     SettingCommand = new RelayCommand <object>(
         sender => { return(true); }, sender =>
     {
         SettingWindow settingWindow = new SettingWindow();
         IsCheck = false;
         settingWindow.ShowDialog();
     });
 }
Example #19
0
        public void SetAocParms()
        {
            try {
                if (String.IsNullOrEmpty(SettingWindowHF.Text.Trim()))
                {
                    var warningMsg = "获取AO参数时发生错误,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var ids = WebUtility.ItemSplit(SettingWindowHF.Text.Trim());
                if (ids.Length != 3)
                {
                    var warningMsg = "AO参数格式错误,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var lscId       = Int32.Parse(ids[0]);
                var nodeId      = Int32.Parse(ids[1]);
                var nodeType    = Int32.Parse(ids[2]);
                var enmNodeType = Enum.IsDefined(typeof(EnmNodeType), nodeType) ? (EnmNodeType)nodeType : EnmNodeType.Null;
                var lscUser     = UserData.LscUsers.Find(lu => { return(lu.LscID == lscId); });
                if (lscUser == null)
                {
                    var warningMsg = "无法获取用户信息,设置失败!";
                    WebUtility.WriteLog(EnmSysLogLevel.Warn, EnmSysLogType.Operating, warningMsg, Page.User.Identity.Name);
                    WebUtility.ShowMessage(EnmErrType.Warning, warningMsg);
                    return;
                }

                var order = new OrderInfo();
                order.LscID      = lscId;
                order.TargetID   = nodeId;
                order.TargetType = enmNodeType;
                order.OrderType  = EnmActType.SetAoc;
                order.RelValue1  = (double.MinValue == SettingSpinnerField.Number ? 0 : SettingSpinnerField.Number).ToString("0.000");
                order.RelValue2  = lscId.ToString();
                order.RelValue3  = lscUser.UserID.ToString();
                order.RelValue4  = lscUser.UserName;
                order.RelValue5  = WebUtility.DefaultString;
                order.UpdateTime = DateTime.Now;

                var orderEntity = new BOrder();
                orderEntity.AddOrder(order);
            } catch (Exception err) {
                WebUtility.WriteLog(EnmSysLogLevel.Error, EnmSysLogType.Exception, err.ToString(), Page.User.Identity.Name);
                WebUtility.ShowMessage(EnmErrType.Error, err.Message);
            } finally {
                SettingSpinnerField.Number = 0;
                SettingWindow.Hide();
            }
        }
Example #20
0
        private void MI_Setting_Click(object sender, RoutedEventArgs e)
        {
            GlobalSetting.TimeRulerStart           = (int)(TimeStart);
            GlobalSetting.TimeRulerEnd             = (int)(TimeEnd);
            GlobalSetting.TimeRulerDivideNumber    = DivideNumber;
            GlobalSetting.TimeRulerSubDivideNumber = SubDivideNumber;
            SettingWindow swin = new SettingWindow();

            swin.EnsureButtonClick += W_Setting_Ensure_Click;
            swin.Show();
        }
Example #21
0
        private void btnSetting_Click(object sender, RoutedEventArgs e)
        {
            SettingWindow setting = new SettingWindow(_subsystem)
            {
                Owner = Application.Current.MainWindow
            };

            Log.Debug("btnSetting_Click__setting.ShowDialog BEFORE");
            setting.ShowDialog();
            Log.Debug("btnSetting_Click__setting.ShowDialog AFTER");
        }
Example #22
0
    private void Awake()
    {
        if (Instance != null)
        {
            Debug.LogError("Double instantiation : " + this);
            Destroy(this);
            return;
        }

        Instance = this;
    }
Example #23
0
        //private void CaptureJpeg()
        //{
        //    string sJpegPicFileName;
        //    //ͼƬ±£´æ·¾¶ºÍÎļþÃû the path and file name to save
        //    sJpegPicFileName = "JPEG_test.jpg";

        //    int lChannel = Int16.Parse(dvrControl.dvrObject.Channel); //ͨµÀºÅ Channel number

        //    CHCNetSDK.NET_DVR_JPEGPARA lpJpegPara = new CHCNetSDK.NET_DVR_JPEGPARA();
        //    lpJpegPara.wPicQuality = 0; //ͼÏñÖÊÁ¿ Image quality
        //    lpJpegPara.wPicSize = 0xff; //ץͼ·Ö±æÂÊ Picture size: 2- 4CIF£¬0xff- Auto(ʹÓõ±Ç°ÂëÁ÷·Ö±æÂÊ)£¬×¥Í¼·Ö±æÂÊÐèÒªÉ豸֧³Ö£¬¸ü¶àÈ¡ÖµÇë²Î¿¼SDKÎĵµ

        //    //JPEGץͼ Capture a JPEG picture
        //    if (!CHCNetSDK.NET_DVR_CaptureJPEGPicture(m_lUserID, lChannel, ref lpJpegPara, sJpegPicFileName))
        //    {
        //        //fail capture
        //        iLastErr = CHCNetSDK.NET_DVR_GetLastError();
        //        str = "NET_DVR_CaptureJPEGPicture failed, error code= " + iLastErr;
        //        //MessageBox.Show(str);
        //        return;
        //    }
        //    else
        //    {
        //        //success capture
        //        str = "Successful to capture the JPEG file and the saved file is " + sJpegPicFileName;
        //        //MessageBox.Show(str);
        //    }
        //    return;
        //}

        #endregion

        private void OpenSetting(object sender, MouseButtonEventArgs e)
        {
            SigninWindow signinWindow = new SigninWindow();

            signinWindow.ShowDialog();

            if (signinWindow.Loginstatus)
            {
                SettingWindow settingWindow = new SettingWindow();
                settingWindow.ShowDialog();
            }
        }
Example #24
0
        private void Properties_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            // 設定画面を開く
            var win = new SettingWindow();

            win.Owner = this;
            var result = win.ShowDialog();

            if (result == true)
            {
                this.ViewModel.CurrentMode = this.ViewModel.CurrentMode;
            }
        }
Example #25
0
        /// <summary>
        /// ウィンドウが開かれた
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var window = new SettingWindow();

            window.Owner = this;
            window.ShowDialog();
            string apiKey = window.APIKey;

            YoutubeChatClient = new YoutubeChatClient();
            YoutubeChatClient.OnCommentReceiveEach += YoutubeChatClient_OnCommentReceiveEach;
            YoutubeChatClient.OnCommentReceiveDone += YoutubeChatClient_OnCommentReceiveDone;
            YoutubeChatClient.APIKey = apiKey;
        }
        private void OnOKClicked(object parameter)
        {
            List <ModuleChannel> displaySelection = new  List <ModuleChannel>()
            {
                display1Selection, display2Selection, display3Selection, display4Selection, display5Selection, display6Selection
            };
            SettingWindow windowResult = new SettingWindow(Int32.Parse(TimeAxisSelectedItem), settingWindow.UserTabDisplays, displaySelection, settingWindow.TabEnabled);

            SettingFBGA fbgaResult = new SettingFBGA(settingFBGA.NumberOfChannels, integrationTime, sledPower, _highDynamicRangeMode, settingFBGA.SelectedDisplays);
            SettingMIC  micResult  = new SettingMIC(settingMIC.NumberOfChannels, MIC1MuteSelected, MIC2MuteSelected, MIC3MuteSelected, MIC4MuteSelected, HighPassFilterSelected, MICSyncSelected, settingMIC.SelectedDisplays);
            SettingECG  ecgResult  = new SettingECG(settingECG.NumberOfChannels, false, ecgGain, ECGCH4modeSelectedItem, sensP, sensN, settingECG.SelectedDisplays);

            this.CloseDialogWithResult(parameter as Window, new DialogResultSetting(windowResult, fbgaResult, micResult, ecgResult));
        }
Example #27
0
        private static void CreateSettingWindow()
        {
            if (_displaySubWindowList.Any(w => w.SubWindowName == Define.SubWindowName.SettingWindow))
            {
                // 既に開かれているなら何もせず戻る
                return;
            }

            SettingWindow settingWindow = new SettingWindow();

            _displaySubWindowList.Add(new SubWindowData(settingWindow, Define.SubWindowName.SettingWindow));

            settingWindow.ShowDialog();
        }
        void btnSetting(object sender, RoutedEventArgs e)
        {
            IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());

            SettingWindow settingWindow = new SettingWindow();

            IPAddress[] address = ipHostInfo.AddressList;
            settingWindow.ipLists.Clear();
            for (int i = 0; i < address.Length; i++)
            {
                settingWindow.ipLists.Add(address[i].ToString());
            }
            settingWindow.ReStartServer += RestartServer;
            settingWindow.Show();
        }
Example #29
0
        private void Setting_Click(object sender, RoutedEventArgs e)
        {
            SettingWindow setting = new SettingWindow();

            setting.ShowDialog();

            // If user enteres ip and port to change and pressed ok.
            if (setting.IsOk)
            {
                mainVM.Ip         = setting.ipText.Text;
                mainVM.Port       = int.Parse(setting.portText.Text);
                ipLabel.Content   = mainVM.Ip;
                portLabel.Content = mainVM.Port;
                setting.IsOk      = false;
            }
        }
 protected override void OnWindowInitialized(HwndSource hwndSource)
 {
     _hwndSource = hwndSource;
     Logger.Write("Starting application.");
     StartAllFunctions();
     Logger.Write("Application started.");
     if (SettingManager.IsFirstRun)
     {
         if (_settingWindow == null)
         {
             _settingWindow         = new SettingWindow();
             _settingWindow.Closed += OnSettingWindowClosed;
         }
         _settingWindow.Show();
     }
 }
Example #31
0
        private async Task Set()
        {
            Log.Instance.Logger.Info("settings");

            SettingWindow setWin = new SettingWindow();

            setWin.Owner = MainWindow.Instance;
            SettingsViewModel setVM = (setWin.DataContext) as SettingsViewModel;

            setVM.SelectedPortName = this.PortName;

            if (setWin.ShowDialog() ?? false)
            {
                this.PortName = setVM.SelectedPortName;
                this.RaisePropertyChanged(nameof(IsOpened));
            }
        }
Example #32
0
 // Use this for initialization
 void Start()
 {
     pg = programStates.StartWindow;
     sw = new SettingWindow(pg);
 }
Example #33
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (settingsWindowShowFlag == true)
            {
                MessageBox.Show("�T�[�r�X�̍X�V���ł��B���΂炭���҂���������");
                return;
            }

            try
            {
                using (SettingWindow settingWindow = new SettingWindow())
                {
                    settingWindow.Owner = System.Windows.Application.Current.Windows[0];
                    settingWindow.ShowDialog();
                    if (settingWindow.DialogResult != true) return;
                    if (settingWindow.DataFormatCheck() != "") return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("��肪�����������߃E�C���h�E��\���ł��܂���ł���\r\n" + ex.Message);
                return;
            }

            QueryGrid.Children.Clear();

            if (Settings.Default.TreeRadioButton == true)
                QueryGrid.Children.Add(new FileShareTreeQueryControl_2());

            if (Settings.Default.TabRadioButton == true)
                QueryGrid.Children.Add(new FileShareTabQueryControl());

            Thread stopThread = new Thread(new ThreadStart(delegate()
            {
                settingsWindowShowFlag = true;

                StopService();
            }));
            stopThread.Start();

            Thread startThread = new Thread(new ThreadStart(delegate()
            {
                stopThread.Join();
                StartService();

                settingsWindowShowFlag = false;
            }));
            startThread.Start();
        }