public override void ShowTemplateProperty(ReportTemplate report)
        {
            Workbook book = report.ToWorkbook();

            if (book == null)
            {
                return;
            }

            if (book.Worksheets.BuiltInDocumentProperties.Contains("Author"))
            {
                SettingControl.Author = book.Worksheets.BuiltInDocumentProperties["Author"].Value + "";
            }
            else
            {
                SettingControl.Author = string.Empty;
            }

            if (book.Worksheets.BuiltInDocumentProperties.Contains("LastSavedTime"))
            {
                SettingControl.LastSaveTime = SettingControl.ParseToDateTime(book.Worksheets.BuiltInDocumentProperties["LastSavedTime"].Value);
            }
            else
            {
                SettingControl.LastSaveTime = DateTime.MinValue;
            }

            SettingControl.TemplateSpace = Encoding.UTF8.GetByteCount(report.ToBase64());
        }
Пример #2
0
 void Start()
 {
     GPGSMng.GetInstance.InitializeGPGS();
     this.Set_Control = this.GetComponent <SettingControl>();
     //if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.OSXPlayer)
     useGUILayout = false;
 }
Пример #3
0
        private void CreateSettingControl()
        {
            SettingControl settingCtrl = new SettingControl(_settings);

            settingCtrl.Parent = _pageSettings;
            settingCtrl.Dock   = DockStyle.Fill;
        }
Пример #4
0
        public async void NavView_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
        {
            if ((SettingControl?.IsOpened).GetValueOrDefault())
            {
                if (Nav.CurrentSourcePageType == typeof(TabViewContainer))
                {
                    NavView.IsBackEnabled = (TabViewContainer.CurrentTabNavigation?.CanGoBack).GetValueOrDefault();
                }
                else
                {
                    NavView.IsBackEnabled = false;
                }

                if (NavView.MenuItems.Select((Item) => Item as NavigationViewItem).FirstOrDefault((Item) => Item.Content.ToString() == PageDictionary[Nav.CurrentSourcePageType]) is NavigationViewItem Item)
                {
                    Item.IsSelected = true;
                }

                await SettingControl.Hide().ConfigureAwait(false);
            }
            else
            {
                TabViewContainer.GoBack();
            }
        }
        /// <summary>
        /// 各コントロールの初期化を行う
        /// </summary>
        /// <param name="settingInfo">
        /// 音声認識に対するマッチングパターンと操作の設定情報
        /// </param>
        public void Initialize(SpeechRecognitionSettingInfo settingInfo)
        {
            // 引数の音声認識に対するマッチングパターンと操作の設定情報を保持する
            // NULLが指定された場合は初期値を設定する
            CurrentSpeechRecognitionSettingInfo = settingInfo;
            SettingInfo = settingInfo ?? new SpeechRecognitionSettingInfo();
            SpeechRecognitionSettingInfo info = SettingInfo.DeepCopy();

            // マッチングメッセージのテキストボックスを設定
            if (!string.IsNullOrEmpty(info.MatchMessage))
            {
                TxtMatchMessage.Text = info.MatchMessage;
                IsSetMatchMessage    = true;
            }
            else
            {
                // マッチングメッセージが存在しない場合はデフォルトの値を設定する
                TxtMatchMessage.Text = DefaultMatchMessage;
                IsSetMatchMessage    = false;
            }

            // マッチングメッセージの文字色を初期化
            SetMatchMessageForeColor(IsSetMatchMessage);

            // マッチングパターンのラジオボタン領域は非表示
            PlMatchPattern.Visible = false;

            // 設定情報のマッジングパターンに紐づくラジオボタンコントロールを取得
            RadioButton radio = GetRadio(info.MatchPattern);

            // ラジオボタンコントロールが取得できた場合はそのラジオボタンをチェックする
            if (radio != null)
            {
                radio.Checked = true;
            }
            else if ((radio = GetCheckedRadio()) != null)
            {
                // チェック対象のラジオボタンが存在しない場合は、
                // チェックされているラジオボタンのチェックを外し、すべてが未チェック状態にする
                radio.Checked = false;
            }

            // 拡大縮小ボタンの初期化
            IsSummary = true;
            SetBackgroundImageForBtMinMax(IsSummary);

            // 概要ラベルを設定
            SetSummaryText(info);
            LbSummaryText.Visible = true;

            // 操作設定用のコントロールを設定
            // (非表示にするためコントロールオブジェクトを解放する)
            if (SettingControl != null)
            {
                PlControl.Controls.Remove(SettingControl);
                SettingControl.Dispose();
                SettingControl = null;
            }
        }
        /// <summary>
        /// 拡大縮小表示の切り替えボタン押下のイベント
        /// </summary>
        /// <param name="sender">センダーオブジェクト</param>
        /// <param name="e">イベントデータ</param>
        private void BtMinMax_Click(object sender, EventArgs e)
        {
            // 概要表示フラグを切り替える
            IsSummary = !IsSummary;

            // マッチングパターンのラジオボタン領域の表示を切り替える
            PlMatchPattern.Visible = !IsSummary;

            // 拡大縮小ボタンの表示を切り替える
            SetBackgroundImageForBtMinMax(IsSummary);

            // 操作設定エリアの表示を切り替える
            if (IsSummary)
            {
                // 縮小の場合
                // 概要ラベルを表示する
                LbSummaryText.Visible = true;
                SetSummaryText(SettingInfo);

                // 操作設定用のコントロールを設定
                // (非表示にするためコントロールオブジェクトを解放する)
                if (SettingControl != null)
                {
                    PlControl.Controls.Remove(SettingControl);
                    SettingControl.Dispose();
                    SettingControl = null;
                }
            }
            else
            {
                // 拡大の場合
                // 操作設定用のコントロールを取得する
                SettingControl?.Dispose();
                SettingControl = SettingInfo.SettingControl;
                if (SettingControl != null)
                {
                    // 操作設定用のコントロールが存在する場合
                    // 概要ラベルを設定
                    LbSummaryText.Visible = false;

                    // 設定変更イベントを設定
                    (SettingControl as ISpeechRecognitionSettingControl).SettingDataChanged
                        += new EventHandler(SettingControl_SettingDataChanged);

                    // 操作設定用のコントロールを設定
                    PlControl.Controls.Add(SettingControl);
                }
                else
                {
                    // 操作設定用のコントロールが存在しない場合
                    // 概要ラベルを表示する
                    LbSummaryText.Visible = true;
                    SetSummaryText(SettingInfo);
                }
            }
        }
Пример #7
0
        private async void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
        {
            try
            {
                if (args.IsSettingsInvoked)
                {
                    _ = FindName(nameof(SettingControl));

                    await SettingControl.Show().ConfigureAwait(true);

                    NavView.IsBackEnabled = true;
                }
                else
                {
                    if ((SettingControl?.IsOpened).GetValueOrDefault())
                    {
                        await SettingControl.Hide().ConfigureAwait(true);
                    }

                    if (args.InvokedItem.ToString() == Globalization.GetString("MainPage_PageDictionary_ThisPC_Label"))
                    {
                        NavView.IsBackEnabled = (TabViewContainer.CurrentTabNavigation?.CanGoBack).GetValueOrDefault();
                        Nav.Navigate(typeof(TabViewContainer), null, new SlideNavigationTransitionInfo()
                        {
                            Effect = SlideNavigationTransitionEffect.FromLeft
                        });
                    }
                    else if (args.InvokedItem.ToString() == Globalization.GetString("MainPage_PageDictionary_SecureArea_Label"))
                    {
                        NavView.IsBackEnabled = false;
                        Nav.Navigate(typeof(SecureArea), null, new SlideNavigationTransitionInfo()
                        {
                            Effect = SlideNavigationTransitionEffect.FromRight
                        });
                    }
                    else if (args.InvokedItem.ToString() == Globalization.GetString("MainPage_PageDictionary_RecycleBin_Label"))
                    {
                        NavView.IsBackEnabled = false;
                        Nav.Navigate(typeof(RecycleBin), null, new SlideNavigationTransitionInfo()
                        {
                            Effect = Nav.CurrentSourcePageType == typeof(SecureArea) ? SlideNavigationTransitionEffect.FromLeft : SlideNavigationTransitionEffect.FromRight
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionTracer.RequestBlueScreen(ex);
            }
        }
Пример #8
0
 private void InitSettingControl(ControlCollection cc)
 {
     foreach (Control uc in cc)
     {
         if (uc.Controls != null)
         {
             InitSettingControl(uc.Controls);
         }
         if (uc is DevExpress.XtraEditors.LabelControl && !SettingControl.Contains(uc))
         {
             SettingControl.Add(uc);
         }
     }
 }
Пример #9
0
        private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            if (e.NewValue != null)
            {
                RemoteTreeViewItem selectItem = (RemoteTreeViewItem)e.NewValue;

                if (selectItem.RemoteType != RemoteType.dir)
                {
                    ScrollViewer.Visibility = Visibility.Visible;
                    RemoteItems.GetItemRemoteLink(selectItem.uuid);
                    ScrollViewer.DataContext   = RemoteItems.ItemRemoteLink;
                    TextBox_Password.Password  = RemoteItems.ItemRemoteLink.Password;
                    TextBox_Name.Text          = RemoteItems.ItemRemoteLink.Name;
                    TextBox_Password.IsEnabled = true;

                    _currentSetControl?.UnLoaded();
                    Grid_PrivateKey.Visibility = Visibility.Collapsed;
                    if (selectItem.RemoteType == RemoteType.rdp)
                    {
                        _currentSetControl = PART_SettingRdp;
                    }
                    if (selectItem.RemoteType == RemoteType.ssh)
                    {
                        //加载私钥
                        if (RemoteItems.ItemRemoteLink.PrivateKey == null)
                        {
                            CheckBox_PrivateKey.IsChecked = false;
                        }
                        else
                        {
                            CheckBox_PrivateKey.IsChecked = true;
                        }
                        CheckBox_PrivateKey_Click(null, null);
                        _currentSetControl         = PART_SettingSsh;
                        Grid_PrivateKey.Visibility = Visibility.Visible;
                    }
                    if (selectItem.RemoteType == RemoteType.telnet)
                    {
                        _currentSetControl = PART_SettingTelnet;
                    }
                    Expander_Setting.Content = _currentSetControl;
                    _currentSetControl?.Loaded(RemoteItems.ItemRemoteLink);
                }
                else
                {
                    ScrollViewer.Visibility = Visibility.Collapsed;
                }
            }
        }
Пример #10
0
        /// <summary> 命令通用方法 </summary>
        protected override async void RelayMethod(object obj)

        {
            string command = obj?.ToString();

            //  Do:对话消息
            if (command == "Button.ShowDialogMessage")
            {
                await MessageService.ShowSumitMessge("这是消息对话框?");
            }

            //  Do:等待消息
            else if (command == "Button.ShowWaittingMessge")
            {
                await MessageService.ShowWaittingMessge(() => Thread.Sleep(2000));
            }

            //  Do:百分比进度对话框
            else if (command == "Button.ShowPercentProgress")
            {
                Action <IPercentProgress> action = l =>
                {
                    for (int i = 0; i < 100; i++)
                    {
                        l.Value = i;

                        Thread.Sleep(10);
                    }

                    Thread.Sleep(1000);

                    MessageService.ShowSnackMessageWithNotice("加载完成!");
                };
                await MessageService.ShowPercentProgress(action);
            }

            //  Do:文本进度对话框
            else if (command == "Button.ShowStringProgress")
            {
                Action <IStringProgress> action = l =>
                {
                    for (int i = 1; i <= 100; i++)
                    {
                        l.MessageStr = $"正在提交当前页第{i}份数据,共100份";

                        Thread.Sleep(10);
                    }

                    Thread.Sleep(1000);

                    MessageService.ShowSnackMessageWithNotice("提交完成:成功100条,失败0条!");
                };

                await MessageService.ShowStringProgress(action);
            }

            //  Do:确认取消对话框
            else if (command == "Button.ShowResultMessge")
            {
                var result = await MessageService.ShowResultMessge("确认要退出系统?");

                if (result)
                {
                    MessageService.ShowSnackMessageWithNotice("你点击了取消");
                }
                else
                {
                    MessageService.ShowSnackMessageWithNotice("你点击了确定");
                }
            }

            //  Do:提示消息
            else if (command == "Button.ShowSnackMessage")
            {
                MessageService.ShowSnackMessageWithNotice("这是提示消息?");
            }

            //  Do:气泡消息
            else if (command == "Button.ShowNotifyMessage")
            {
                MessageService.ShowNotifyMessage("你有一条报警信息需要处理,请检查", "Notify By HeBianGu");
            }

            //  Do:气泡消息
            else if (command == "Button.ShowIdentifyNotifyMessage")
            {
                MessageService.ShowNotifyDialogMessage("自定义气泡消息" + DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss"), "友情提示", 5);
            }

            //  Do:气泡消息
            else if (command == "Button.ShowWindowSumitMessage")
            {
                MessageWindow.ShowSumit("这是窗口提示消息", "提示", true);
            }

            //  Do:气泡消息
            else if (command == "Button.ShowWindowResultMessage")
            {
                MessageWindow.ShowDialog("这是窗口提示消息", "提示", -1, true);
            }

            //  Do:气泡消息
            else if (command == "Button.ShowWindowIndentifyMessage")
            {
                List <Tuple <string, Action <MessageWindow> > > acts = new List <Tuple <string, Action <MessageWindow> > >();


                Action <MessageWindow> action = l =>
                {
                    l.CloseAnimation(l);

                    l.Result = true;

                    MessageService.ShowSnackMessageWithNotice("你点到我了!");
                };

                acts.Add(Tuple.Create("按钮一", action));
                acts.Add(Tuple.Create("按钮二", action));
                acts.Add(Tuple.Create("按钮三", action));

                MessageWindow.ShowDialogWith("这是自定义按钮提示消息", "好心提醒", true, acts.ToArray());
            }

            //  Do:气泡消息
            else if (command == "Button.Upgrade")
            {
                UpgradeWindow window = new UpgradeWindow();
                window.TitleMessage = "发现新版本:V3.0.1";
                List <string> message = new List <string>();
                message.Add("1、增加了检验更新和版本下载");
                message.Add("2、增加了Mvc跳转页面方案");
                message.Add("3、修改了一些已知BUG");
                window.Message = message;

                var find = window.ShowDialog();

                if (find.HasValue && find.Value)
                {
                    DownLoadWindow downLoad = new DownLoadWindow();
                    downLoad.TitleMessage = "正在下载新版本:V3.0.1";
                    downLoad.Url          = @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4";
                    downLoad.Message      = message;
                    downLoad.ShowDialog();
                }

                //UpgradeWindow.BeginUpgrade("发现新版本:V3.0.1", @"http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
                //   message.ToArray());
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.Message.Error"))
            {
                ErrorMessage message = new ErrorMessage();

                message.Message = "错误信息!";

                this.AddMessage(message, command);
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.Message.Info"))
            {
                InfoMessage message = new InfoMessage();

                message.Message = "提示信息!";

                this.AddMessage(message, command);
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.Message.Success"))
            {
                SuccessMessage message = new SuccessMessage();

                message.Message = "保存成功!";

                this.AddMessage(message, command);
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.Message.Fatal"))
            {
                FatalMessage message = new FatalMessage();

                message.Message = "问题很严重!";

                this.AddMessage(message, command);
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.Message.Warn"))
            {
                WarnMessage message = new WarnMessage();

                message.Message = "警告信息!";

                this.AddMessage(message, command);
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.Message.Dailog"))
            {
                DailogMessage message = new DailogMessage();

                message.Message = "可以保存了么?";

                this.AddMessage(message, command);
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.ShowCoverMessge"))
            {
                SettingControl setting = new SettingControl();

                MessageService.ShowWithLayer(setting);
            }

            //  Do:气泡消息
            else if (command.StartsWith("Button.ShowObjectWithPropertyForm"))
            {
                Student student = new Student();

                await MessageService.ShowObjectWithPropertyForm(student, l => true, "修改学生信息");
            }

            //  Do:气泡消息
            else if (command == "Button.ShowObjectWithContent")
            {
                Student student = new Student();

                Predicate <Student> match = l =>
                {
                    if (this.random.Next(3) == 1)
                    {
                        MessageService.ShowSnackMessageWithNotice("随机测试提交失败,请再试几次");
                        return(false);
                    }
                    else
                    {
                        MessageService.ShowSnackMessageWithNotice("随机测试提交成功,请再试几次");
                        return(true);
                    }
                };

                await MessageService.ShowObjectWithContent(student, match, "修改学生信息");
            }

            //  Do:气泡消息
            else if (command == "Button.ShowObjectWithContent.WithValidation")
            {
                StudentViewModel student = new StudentViewModel();

                Predicate <StudentViewModel> match = l =>
                {
                    //if (ObjectPropertyFactory.ModelState(student.Model,out List<string> errors))
                    if (student.ModelState(out List <string> errors))
                    {
                        MessageService.ShowSnackMessageWithNotice("提交成功");
                        return(true);
                    }
                    else
                    {
                        MessageService.ShowSnackMessageWithNotice(errors?.FirstOrDefault());
                        return(false);
                    }
                };

                await MessageService.ShowObjectWithContent(student, match, "修改学生信息");
            }
            else if (command == "Button.Add")
            {
                if (this.StoryBoardPlayerViewModel.PlayMode)
                {
                    MessageService.ShowSnackMessageWithNotice("请先停止播放再进行添加!");
                    return;
                }
                this.StoryBoardPlayerViewModel.Create();
            }
            else if (command == "init")
            {
                for (int i = 0; i < 60; i++)
                {
                    ComboBoxItems.Add(new FComboBoxItemModel()
                    {
                        Header    = "ComboBoxItem" + (ComboBoxItems.Count + 1),
                        Value     = (ComboBoxItems.Count + 1),
                        CanDelete = true
                    });
                }
            }
        }