Пример #1
0
        void Settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            try
            {
                var viewAboutPage = new SettingsCommand("", "Об авторе", cmd =>
                {
                    Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout();
                    settings.Width = 500;
                    //settings.HeaderBackground = new SolidColorBrush(App.VisualElements.BackgroundColor);
                    //.HeaderForeground = new SolidColorBrush(Colors.Black);
                    settings.Title      = "Об авторе"; //string.Format("{0} Custom 2", App.VisualElements.DisplayName);
                    settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo);
                    settings.Content    = new About();
                    settings.Show();
                });
                args.Request.ApplicationCommands.Add(viewAboutPage);

                var viewAboutMalukahPage = new SettingsCommand("", "Политика конфиденциальности", cmd =>
                {
                    Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout();
                    settings.Width = 500;
                    //settings.HeaderBackground = new SolidColorBrush(App.VisualElements.BackgroundColor);
                    //.HeaderForeground = new SolidColorBrush(Colors.Black);
                    settings.Title      = "Политика конфиденциальности"; //string.Format("{0} Custom 2", App.VisualElements.DisplayName);
                    settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo);
                    settings.Content    = new Privacy();
                    settings.Show();
                });
                args.Request.ApplicationCommands.Add(viewAboutMalukahPage);
            }
            catch { };
        }
Пример #2
0
        /// <summary>
        /// Define Settings Pages for the application once the OnCommandsRequested event is raised.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        void Settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            Color _background = Color.FromArgb(255, 178, 34, 34);

            // Add an About command
            var About = new SettingsCommand("About", "About", (handler) =>
            {
                var settings         = new SettingsFlyout();
                settings.Content     = new AboutPage();
                settings.HeaderBrush = new SolidColorBrush(_background);
                settings.Background  = new SolidColorBrush(_background);
                settings.HeaderText  = "About";
                settings.IsOpen      = true;
            });

            var Settings = new SettingsCommand("Settings", "Settings", (handler) =>
            {
                var settings         = new SettingsFlyout();
                settings.Content     = new SettingsPage();
                settings.HeaderBrush = new SolidColorBrush(_background);
                settings.Background  = new SolidColorBrush(_background);
                settings.HeaderText  = "Settings";
                settings.IsOpen      = true;
            });



            args.Request.ApplicationCommands.Add(About);
            //args.Request.ApplicationCommands.Add(Settings);
        }
        void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("login", "登录", (x) =>
            {
                _settingsPopup                       = new Popup();
                _settingsPopup.Closed               += OnPopupClosed;
                Window.Current.Activated            += OnWindowActivated;
                _settingsPopup.IsLightDismissEnabled = true;
                _settingsPopup.Width                 = _settingsWidth;
                _settingsPopup.Height                = _windowBounds.Height;

                SimpleSettingsNarrow mypane = new SimpleSettingsNarrow();
                mypane.Width  = _settingsWidth;
                mypane.Height = _windowBounds.Height;

                _settingsPopup.Child = mypane;
                _settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
                _settingsPopup.SetValue(Canvas.TopProperty, 0);
                _settingsPopup.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(cmd);

            SettingsCommand cmd1 = new SettingsCommand("logout", "注销", (x) =>
            {
            });

            args.Request.ApplicationCommands.Add(cmd1);
        }
Пример #4
0
        private void SettingsCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var privacyStatement = new SettingsCommand("privacy", "Privacy Policy", x => Launcher.LaunchUriAsync(new Uri("http://fybcaprogrammers.blogspot.in/p/privacy-for-windows-8-tips-and-info-app.html")));

            args.Request.ApplicationCommands.Clear();
            args.Request.ApplicationCommands.Add(privacyStatement);
        }
Пример #5
0
        void onSettingsCommand(IUICommand command)
        {
            SettingsCommand settingsCommand = (SettingsCommand)command;

            //  Create a Popup window which will contain our flyout.
            settingsPopup                       = new Popup();
            settingsPopup.Closed               += OnPopupClosed;
            Window.Current.Activated           += OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            settingsPopup.Width                 = settingsWidth;
            settingsPopup.Height                = windowBounds.Height;
            //settingsPopup.Height = Window.Current.Bounds.Height;

            //  Add the proper animations for the flyout
            settingsPopup.ChildTransitions = new Windows.UI.Xaml.Media.Animation.TransitionCollection();
            settingsPopup.ChildTransitions.Add(new Windows.UI.Xaml.Media.Animation.PaneThemeTransition()
            {
                Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? EdgeTransitionLocation.Right : EdgeTransitionLocation.Left
            });

            //  Create a SettingsFlyout the same dimensions as the Popup.
            Settings.SettingsFlyout mypane = new Settings.SettingsFlyout();
            mypane.Width  = settingsWidth;
            mypane.Height = windowBounds.Height;
            //mypane.Height = Window.Current.Bounds.Height;
            //  Place the SettingsFlyout inside out Popup window.
            settingsPopup.Child = mypane;

            //  Define the location of our Popup
            settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            //  now, after all that stuff, open the Flyout
            settingsPopup.IsOpen = true;
        }
Пример #6
0
        /// <summary>
        /// Occurs when the user opens the settings pane. Initializes the setting commands.
        /// </summary>
        /// <param name="sender">The event source.</param>
        /// <param name="args">The event data.</param>
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand colorsCommand = new SettingsCommand("colors", "Font and Colors", OnColorsCommand);

            SettingsCommand privacyPolicyCommand = new SettingsCommand("privacyPolicy", "Privacy Policy", async(x) =>
            {
                await Launcher.LaunchUriAsync(new Uri("http://stefanpodskubkadev.blogspot.co.at/p/remote-terminal-privacy-policy.html"));
            });

            SettingsCommand helpCommand = new SettingsCommand("help", "Help", async(x) =>
            {
                await Launcher.LaunchUriAsync(new Uri("http://stefanpodskubkadev.blogspot.co.at/p/contact.html"));
            });

            SettingsCommand changelogCommand = new SettingsCommand("changelog", "Changelog", (x) =>
            {
                Frame rootFrame = Window.Current.Content as Frame;
                if (rootFrame != null)
                {
                    rootFrame.Navigate(typeof(ChangelogPage));
                }
            });

            args.Request.ApplicationCommands.Add(colorsCommand);
            args.Request.ApplicationCommands.Add(privacyPolicyCommand);
            args.Request.ApplicationCommands.Add(helpCommand);
            args.Request.ApplicationCommands.Add(changelogCommand);
        }
        public void Setup()
        {
            SettingsPane settingsPane = SettingsPane.GetForCurrentView();

            settingsPane.CommandsRequested += (s, e) =>
            {
                SettingsCommand settingsCommand = new SettingsCommand(
                    "CONTRIBUTION_ID",
                    "Contribution",
                    command =>
                {
                    var flyout   = new SettingsFlyout();
                    flyout.Title = "About";

                    flyout.Content = new TextBlock()
                    {
                        Text = "Application uses http://fixer.io/ API for getting the data published by European Central Bank. "
                               + "Thanks to the Fixer API, the application is able to read valid data.",
                        TextAlignment = Windows.UI.Xaml.TextAlignment.Left,
                        TextWrapping  = Windows.UI.Xaml.TextWrapping.Wrap,
                        FontSize      = 14
                    };

                    flyout.HeaderBackground = new SolidColorBrush(Colors.Purple);
                    flyout.HeaderForeground = new SolidColorBrush(Colors.BlanchedAlmond);
                    flyout.Background       = new SolidColorBrush(Colors.Black);
                    flyout.Foreground       = new SolidColorBrush(Colors.White);

                    flyout.Show();
                }
                    );

                e.Request.ApplicationCommands.Add(settingsCommand);
            };
        }
Пример #8
0
        void Settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            try
            {
                var viewAboutPage = new SettingsCommand("", "About", cmd =>
                {
                    //(Window.Current.Content as Frame).Navigate(typeof(AboutPage));
                    var settingsFlyout        = new SettingsFlyout();
                    settingsFlyout.Content    = new About();
                    settingsFlyout.HeaderText = "About";

                    settingsFlyout.IsOpen = true;
                });
                args.Request.ApplicationCommands.Add(viewAboutPage);

                /*var viewAboutMalukahPage = new SettingsCommand("", "About Malukah", cmd =>
                 * {
                 *  var settingsFlyout = new SettingsFlyout();
                 *  settingsFlyout.Content = new AboutMalukah();
                 *  settingsFlyout.HeaderText = "About Malukah";
                 *
                 *  settingsFlyout.IsOpen = true;
                 * });
                 * args.Request.ApplicationCommands.Add(viewAboutMalukahPage);*/
            }
            catch { };
        }
Пример #9
0
 public void ProcessCommand(SettingsCommand command)
 {
     switch (command.Key)
     {
         case "timebank":
             MaximumTimeBank = int.Parse(command.Value);
             break;
         case "time_per_move":
             TimePerMove = int.Parse(command.Value);
             break;
         case "player_names":
             PlayerNames = (command.Value).Split(',');
             break;
         case "your_bot":
             PlayerName = command.Value;
             break;
         case "field_width":
             FieldWidth = int.Parse(command.Value);
             break;
         case "field_height":
             FieldHeight = int.Parse(command.Value);
             break;
         default:
             Console.WriteLine("Invalid match settings command: {0}", command.Key);
             break;
     }
 }
Пример #10
0
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            //Add an About command
            var about = new SettingsCommand("about", "About", (handler) =>
            {
                var settings              = new SettingsFlyout();
                settings.Content          = new AboutUserControl();
                settings.HeaderBackground = new SolidColorBrush(_background);
                settings.Title            = "About";
                settings.Show();
            });

            args.Request.ApplicationCommands.Add(about);

            var preferences = new SettingsCommand("preferences", "Preferences", (handler) =>
            {
                var settings              = new SettingsFlyout();
                settings.Content          = new PreferencesUserControl();
                settings.HeaderBackground = new SolidColorBrush(_background);
                settings.Title            = "Preferences";
                settings.Show();
            });

            args.Request.ApplicationCommands.Add(preferences);
        }
        void OnSettingsPaneCommandsRequested(SettingsPane sender,
                                             SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand aboutCommand = new SettingsCommand(0, "About", OnAboutInvoked);

            args.Request.ApplicationCommands.Add(aboutCommand);
        }
Пример #12
0
        private void SettingCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            scAbout = new SettingsCommand("About", "关于", async(x) =>
            {
            });

            scFeedback = new SettingsCommand("Feedback", "用户反馈", async(x) =>
            {
                var success = await Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:[email protected]", UriKind.RelativeOrAbsolute));
            });

            scPrivacy = new SettingsCommand("Privacy", "隐私策略", async(x) =>
            {
                var success = await Windows.System.Launcher.LaunchUriAsync(new Uri("http://okrwork.sinaapp.com/im/5", UriKind.RelativeOrAbsolute));
            });


            if (!args.Request.ApplicationCommands.Contains(scAbout))
            {
                args.Request.ApplicationCommands.Add(scAbout);
            }

            if (!args.Request.ApplicationCommands.Contains(scFeedback))
            {
                args.Request.ApplicationCommands.Add(scFeedback);
            }

            if (!args.Request.ApplicationCommands.Contains(scPrivacy))
            {
                args.Request.ApplicationCommands.Add(scPrivacy);
            }
        }
Пример #13
0
        ///////////////////////////////////////////////////////////////////////////////////
        // Update with URLs to About, Support and Privacy Policy Web Pages
        ///////////////////////////////////////////////////////////////////////////////////
        void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var rl = new ResourceLoader();

            var aboutCmd = new SettingsCommand("About", rl.GetString("SETTINGS_PANEL_CMD_ABOUT"), async(x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(aboutCmd);

            var supportCmd = new SettingsCommand("Support", rl.GetString("SETTINGS_PANEL_CMD_SUPPORT"), async(x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(supportCmd);

            var policyCmd = new SettingsCommand("PrivacyPolicy", rl.GetString("SETTINGS_PANEL_CMD_PRIVACY_POLICY"), async(x) =>
            {
                await Launcher.LaunchUriAsync(new Uri(""));
            });

            args.Request.ApplicationCommands.Add(policyCmd);
        }
Пример #14
0
        void Horoscope_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            args.Request.ApplicationCommands.Clear();
            SettingsCommand privacy = new SettingsCommand("priv", "Privacy Policy", (uicommand) => { ShowPrivacyPanel(); });

            args.Request.ApplicationCommands.Add(privacy);
        }
Пример #15
0
        void LatticePage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("Lattice", "Layout", (x) =>
            {
                // create a new instance of the flyout
                SettingsFlyout settings = new SettingsFlyout();
                // set the desired width.  If you leave this out, you will get Narrow (346px)
                settings.FlyoutWidth = Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth.Narrow;

                // optionally change header and content background colors away from defaults (recommended)
                // if using Callisto's AppManifestHelper you can grab the element from some member var you held it in
                // settings.HeaderBrush = new SolidColorBrush(App.VisualElements.BackgroundColor);
                settings.HeaderBrush            = new SolidColorBrush(Colors.Orange);
                settings.HeaderText             = "Layout Values"; // string.Format("{0}", App.VisualElements.DisplayName);
                settings.ContentBackgroundBrush = LatticePathDisplay.CanvasBackgroundBrush;
                // provide some logo (preferrably the smallogo the app uses)
                BitmapImage bmp = new BitmapImage(App.VisualElements.SmallLogoUri);
                settings.SmallLogoImageSource = bmp;

                // set the content for the flyout
                LatticeFaceLayoutSettingsContent c = new LatticeFaceLayoutSettingsContent();
                c.DataContext    = viewModel.CurrentPathData;
                settings.Content = c;
                // open it
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            IProjectInfoProvider solutionInfoProvider = new SolutionInfoProvider(this);
            IProjectInfoProvider projectInfoProvider  = new ProjectInfoProvider(this);
            IProjectInfoProvider fileInfoProvider     = new FileInfoProvider(this);

            IProjectInfoProvider solutionSnapshotInfoProvider = new SolutionInfoProvider(this, true);
            IProjectInfoProvider projectSnapshotInfoProvider  = new ProjectInfoProvider(this, true);

            IDexterInfoProvider dexterInfoProvider = new SettingsStoreDexterInfoProvider(this);

            ConfigurationProvider solutionConfigProvider = new ConfigurationProvider(solutionInfoProvider, dexterInfoProvider);
            ConfigurationProvider projectConfigProvider  = new ConfigurationProvider(projectInfoProvider, dexterInfoProvider);
            ConfigurationProvider fileConfigProvider     = new ConfigurationProvider(fileInfoProvider, dexterInfoProvider);

            ConfigurationProvider solutionSnapshotConfigProvider = new ConfigurationProvider(solutionSnapshotInfoProvider, dexterInfoProvider);
            ConfigurationProvider projectSnapshotConfigProvider  = new ConfigurationProvider(projectSnapshotInfoProvider, dexterInfoProvider);

            var commandSet = new Guid("2ed6d891-bce1-414d-8251-80a0800a831f");

            DexterAnalysisCommand fileAnalysisCommand     = new DexterFileAnalysisCommand(this, 0x0102, commandSet, fileConfigProvider);
            DexterAnalysisCommand projectAnalysisCommand  = new DexterSolutionAnalysisCommand(this, 0x0101, commandSet, projectConfigProvider);
            DexterAnalysisCommand solutionAnalysisCommand = new DexterSolutionAnalysisCommand(this, 0x0100, commandSet, solutionConfigProvider);
            DexterAnalysisCommand projectSnapshotCommand  = new DexterSolutionAnalysisCommand(this, 0x0111, commandSet, projectSnapshotConfigProvider);
            DexterAnalysisCommand solutionSnapshotCommand = new DexterSolutionAnalysisCommand(this, 0x0110, commandSet, solutionSnapshotConfigProvider);

            settingsCommand  = new SettingsCommand(this, 0x0103, commandSet);
            dashboardCommand = new DashboardCommand(this, 0x0104, commandSet, dexterInfoProvider);
            cancelCommand    = new CancelCommand(this, 0x0105, commandSet);

            DexterAnalysisCommand solutionAnalysisToolbarCommand = new DexterSolutionAnalysisCommand(this, 0x0200, commandSet, solutionConfigProvider);

            settingsToolbarCommand  = new SettingsCommand(this, 0x0203, commandSet);
            dashboardToolbarCommand = new DashboardCommand(this, 0x0204, commandSet, dexterInfoProvider);
            cancelToolbarCommand    = new CancelCommand(this, 0x0205, commandSet);

            analysisCommands.Add(fileAnalysisCommand);
            analysisCommands.Add(projectAnalysisCommand);
            analysisCommands.Add(solutionAnalysisCommand);
            analysisCommands.Add(projectSnapshotCommand);
            analysisCommands.Add(solutionSnapshotCommand);
            analysisCommands.Add(solutionAnalysisToolbarCommand);

            foreach (DexterAnalysisCommand analysisCommand in analysisCommands)
            {
                analysisCommand.AnalysisStarted  += onAnalysisStarted;
                analysisCommand.AnalysisFinished += onAnalysisFinished;
            }

            SettingsPage settingsPage = (SettingsPage)GetDialogPage(typeof(SettingsPage));

            settingsPage.SettingsChanged += onSettingsChanged;

            PeerReviewService.Instance = new PeerReviewService(new DexterTextService());

            RegisterSolutionManager();
            CreateReviewCommentManager();

            base.Initialize();
        }
Пример #17
0
        void Settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            try
            {
                var viewAboutPage = new SettingsCommand("", "Об авторе", cmd =>
                {
                    //(Window.Current.Content as Frame).Navigate(typeof(AboutPage));
                    var settingsFlyout        = new SettingsFlyout();
                    settingsFlyout.Content    = new About();
                    settingsFlyout.HeaderText = "Об авторе";

                    settingsFlyout.IsOpen = true;
                });
                args.Request.ApplicationCommands.Add(viewAboutPage);

                var viewAboutMalukahPage = new SettingsCommand("", "Политика конфиденциальности", cmd =>
                {
                    var settingsFlyout        = new SettingsFlyout();
                    settingsFlyout.Content    = new Privacy();
                    settingsFlyout.HeaderText = "Политика конфиденциальности";

                    settingsFlyout.IsOpen = true;
                });
                args.Request.ApplicationCommands.Add(viewAboutMalukahPage);

                var refreshDatabase = new SettingsCommand("", "Обновить базу данных", cmd =>
                {
                    ViewModelLocator.MainStatic.LoadTouristQuery();
                });
                args.Request.ApplicationCommands.Add(refreshDatabase);
            }
            catch { };
        }
Пример #18
0
        private void OnCommandRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var presSettings = new SettingsCommand("ItCompPresentation", "Présentation ITComp", handler =>
            {
                //(Window.Current.Content as Frame).Navigate(typeof(PresentationView));
                new PresentationSettingsFlyout().Show();
            });
            var contactsSettings = new SettingsCommand("contactsSettings", "Contacts", handler =>
            {
                //(Window.Current.Content as Frame).Navigate(typeof(ContactView));
                new ContactSettingsFlyout().Show();
            });

            var globalSettings = new SettingsCommand("globalSettings", "Paramètres globaux", handler =>
            {
                //(Window.Current.Content as Frame).Navigate(typeof(ContactView));
                new MainSettingsFlyout().Show();
            });
            var aboutSettings   = new SettingsCommand("about ", "A propos ", handler => new AboutSettingsFlyout().Show());
            var privacySettings = new SettingsCommand("PrivacyPolicy ", "Politique de confidentialité ", handler => new PrivacyPolicySettingsFlyout().Show());

            args.Request.ApplicationCommands.Add(presSettings);
            args.Request.ApplicationCommands.Add(contactsSettings);
            args.Request.ApplicationCommands.Add(globalSettings);
            args.Request.ApplicationCommands.Add(privacySettings);
            args.Request.ApplicationCommands.Add(aboutSettings);
        }
Пример #19
0
        void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs e)
        {
            string    hakkindatitle = "Hakkında";
            string    dilayarititle = "Dil Ayarları";
            MainPage1 main          = new MainPage1();

            if (main.dilayar.Values["dil"].ToString() == "Türkçe")
            {
                hakkindatitle = "Hakkında";
                dilayarititle = "Dil Ayarları";
            }
            else if (main.dilayar.Values["dil"].ToString() == "English")
            {
                hakkindatitle = "About";
                dilayarititle = "Language Settings";
            }
            SettingsCommand defaultscommand = new SettingsCommand("hakkında", hakkindatitle,
                                                                  (handler) =>
            {
                Hakkinda hakkinda = new Hakkinda();
                hakkinda.Show();
            });
            SettingsCommand dilayaricommand = new SettingsCommand("dilayarları", dilayarititle,
                                                                  (handler2) =>
            {
                DilAyarlari dilayari = new DilAyarlari();
                dilayari.Show();
            });

            e.Request.ApplicationCommands.Add(defaultscommand);
            e.Request.ApplicationCommands.Add(dilayaricommand);
        }
Пример #20
0
        public Result OnStartup(UIControlledApplication app)
        {
            // (Konrad) Initiate Nlog logger.
            NLogUtils.CreateConfiguration();
            _logger = LogManager.GetCurrentClassLogger();

            // (Konrad) Setup Document events.
            app.ControlledApplication.DocumentOpened  += OnDocumentOpened;
            app.ControlledApplication.DocumentCreated += OnDocumentCreated;
            app.ControlledApplication.DocumentSaving  += OnDocumentSaving;
            app.ControlledApplication.DocumentSynchronizingWithCentral += OnDocumentSynchronizingWithCentral;
            app.ControlledApplication.DocumentSynchronizedWithCentral  += OnDocumentSynchronizedWithCentral;
            app.ControlledApplication.FailuresProcessing += FailureProcessor.CheckFailure;
            app.ViewActivated += OnViewActivated;

            app.CreateRibbonTab("Honeybee");
            var panel = app.CreateRibbonPanel("Honeybee", "Honeybee");

            SettingsCommand.CreateButton(panel);
            var hbButton    = CreateHbModelCommand.CreateButton();
            var dfButton    = CreateDfModelCommand.CreateButton();
            var splitButton = new SplitButtonData("CreateModelCommand", "Split");
            var sb          = (SplitButton)panel.AddItem(splitButton);

            sb.AddPushButton(hbButton);
            sb.AddPushButton(dfButton);

            CreateModelHandler = new CreateModelRequestHandler();
            CreateModelEvent   = ExternalEvent.Create(CreateModelHandler);

            // (Konrad) Register an updater that will watch annotations for changes.
            AnnotationUpdater = new AnnotationUpdater(app.ActiveAddInId);

            return(Result.Succeeded);
        }
Пример #21
0
        private void onConnectionSettingsCommand(IUICommand command)
        {
            SettingsCommand settingsCommand = (SettingsCommand)command;

            if (connectionSettingsPopup == null)
            {
                connectionSettingsPopup = new Popup();

                connectionSettingsPopup.IsLightDismissEnabled = true;
                connectionSettingsPopup.Width  = settingsWidth;
                connectionSettingsPopup.Height = Window.Current.Bounds.Height;

                connectionSettingsPopup.ChildTransitions = new TransitionCollection();
                connectionSettingsPopup.ChildTransitions.Add(new PaneThemeTransition()
                {
                    Edge = (SettingsPane.Edge == SettingsEdgeLocation.Right) ?
                           EdgeTransitionLocation.Right :
                           EdgeTransitionLocation.Left
                });

                ConnectionSettings mypane = new ConnectionSettings();
                mypane.Width  = settingsWidth;
                mypane.Height = Window.Current.Bounds.Height;

                connectionSettingsPopup.Child = mypane;

                connectionSettingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (Window.Current.Bounds.Width - settingsWidth) : 0);
                connectionSettingsPopup.SetValue(Canvas.TopProperty, 0);
            }
            connectionSettingsPopup.IsOpen = true;
        }
        /// <summary>
        /// Define Settings Pages for the application once the OnCommandsRequested event is raised.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var travelerInfo = new SettingsCommand("TravelerInfo", ResourceHelper.ResourceLoader.GetString("TravelerInfo"), (handler) =>
            {
                var settings = new SettingsFlyout();
                settings.ShowFlyout(new TravelerInfoControl());
            });

            args.Request.ApplicationCommands.Add(travelerInfo);

            var about = new SettingsCommand("About", ResourceHelper.ResourceLoader.GetString("About"), (handler) =>
            {
                var settings = new SettingsFlyout();
                settings.ShowFlyout(new AboutControl());
            });

            args.Request.ApplicationCommands.Add(about);

            var options = new SettingsCommand("Options", ResourceHelper.ResourceLoader.GetString("Options"), (handler) =>
            {
                var settings = new SettingsFlyout();
                settings.ShowFlyout(new OptionsControl());
            });

            args.Request.ApplicationCommands.Add(options);
        }
Пример #23
0
        private void _rightMenuButton_Clicked(object sender, System.EventArgs e)
        {
            switch (RightMenu)
            {
            case RightMenuIcon.Add:
                AddCommand?.Execute(null);
                break;

            case RightMenuIcon.CustomText:
            case RightMenuIcon.CustomIcon:
                RightMenuCommand?.Execute(null);
                break;

            case RightMenuIcon.Delete:
                DeleteCommand?.Execute(null);
                break;

            case RightMenuIcon.Edit:
                EditCommand?.Execute(null);
                break;

            case RightMenuIcon.Save:
                SaveCommand?.Execute(null);
                break;

            case RightMenuIcon.Settings:
                SettingsCommand?.Execute(null);
                break;
            }
        }
Пример #24
0
        void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add an About command
            var about = new SettingsCommand("about", "Über", (handler) =>
            {
                var settings     = new Callisto.Controls.SettingsFlyout();
                settings.Content = new AboutUserControl();

                var backgroundBrush = ResourceService.Get <SolidColorBrush>("AppBackgroundColorBrush");
                // settings.HeaderBrush = backgroundBrush;
                settings.ContentBackgroundBrush = backgroundBrush;
                settings.HeaderText             = "Über";
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(about);

            // Add a Preferences command
            var preferences = new SettingsCommand("preferences", "Einstellungen", (handler) =>
            {
                var settings     = new Callisto.Controls.SettingsFlyout();
                settings.Content = new PreferencesUserControl();

                var backgroundBrush = ResourceService.Get <SolidColorBrush>("AppBackgroundColorBrush");
                // settings.HeaderBrush = backgroundBrush;
                settings.ContentBackgroundBrush = backgroundBrush;
                settings.HeaderText             = "Einstellungen";
                settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(preferences);
        }
Пример #25
0
        void AircraftsPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            UICommandInvokedHandler invokeHandler = new UICommandInvokedHandler(AboutInvokeHandler);
            SettingsCommand         aboutCommand  = new SettingsCommand("About", "About Invaders", invokeHandler);

            args.Request.ApplicationCommands.Add(aboutCommand);
        }
Пример #26
0
        //none
#else
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            // Add an About command
            var about = new SettingsCommand("About", "About", (handler) =>
            {
                about flyout = new about();
                flyout.Title = "About";
                flyout.Show();
                //var settings = new SettingsFlyout();
                //settings.Content = new about();
                //settings.HeaderBrush = new SolidColorBrush(_background);
                //settings.Background = new SolidColorBrush(_background);
                //settings.HeaderText = "About";
                //settings.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(about);

            // add a Privacy and policy command
            var privacy = new SettingsCommand("Privacy Policy", "Privacy Policy", (handler) =>
            {
                var uri = new Uri("//your link of privacy and policy");
                //hena hn7oot el elink ely feh el Privacy policy
                IAsyncOperation <bool> x = Windows.System.Launcher.LaunchUriAsync(uri);
            });

            args.Request.ApplicationCommands.Add(privacy);
        }
        /// <summary>
        /// This event is generated when the user opens the settings pane. During this event, append your
        /// SettingsCommand objects to the available ApplicationCommands vector to make them available to the
        /// SettingsPange UI.
        /// </summary>
        /// <param name="settingsPane">Instance that triggered the event.</param>
        /// <param name="eventArgs">Event data describing the conditions that led to the event.</param>
        private void onCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs)
        {
            var handler        = new UICommandInvokedHandler(onSettingsCommand);
            var generalCommand = new SettingsCommand("ServerSettingsId", "Server Settings", handler);

            eventArgs.Request.ApplicationCommands.Add(generalCommand);
        }
Пример #28
0
        void Settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            try
            {
                var viewAboutPage = new SettingsCommand("", "Об авторе", cmd =>
                {
                    //(Window.Current.Content as Frame).Navigate(typeof(AboutPage));
                    var settingsFlyout        = new SettingsFlyout();
                    settingsFlyout.Content    = new About();
                    settingsFlyout.HeaderText = "Об авторе";

                    settingsFlyout.IsOpen = true;
                });
                args.Request.ApplicationCommands.Add(viewAboutPage);

                var viewAboutMalukahPage = new SettingsCommand("", "Политика конфиденциальности", cmd =>
                {
                    var settingsFlyout        = new SettingsFlyout();
                    settingsFlyout.Content    = new Privacy();
                    settingsFlyout.HeaderText = "Политика конфиденциальности";

                    settingsFlyout.IsOpen = true;
                });
                args.Request.ApplicationCommands.Add(viewAboutMalukahPage);
            }
            catch { };
        }
Пример #29
0
        private void OnSettingsCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand(
                "about",
                "About",
                (x) =>
            {
                _settingsPopup                       = new Popup();
                _settingsPopup.Closed               += OnSettingsPopupClosed;
                Window.Current.Activated            += OnWindowActivated;
                _settingsPopup.IsLightDismissEnabled = true;
                _settingsPopup.Width                 = 346;
                _settingsPopup.Height                = Window.Current.Bounds.Height;

                AboutPanel mypane = new AboutPanel();
                mypane.Width      = _settingsPopup.Width;
                mypane.Height     = Window.Current.Bounds.Height;

                _settingsPopup.Child = mypane;
                _settingsPopup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - _settingsPopup.Width);
                _settingsPopup.SetValue(Canvas.TopProperty, 0);
                _settingsPopup.IsOpen = true;
            });

            args.Request.ApplicationCommands.Add(cmd);
        }
Пример #30
0
        private void DisplaySettingsFlyout(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            SettingsCommand cmd = new SettingsCommand("Credits", "Credits", (x) =>
            {
                Users flyout = new Users();
                flyout.Title = "Aplicație realizată de";
                flyout.Show();
            });

            args.Request.ApplicationCommands.Add(cmd);

            SettingsCommand cmd2 = new SettingsCommand("Privacy Settings", "Privacy Settings", (x) =>
            {
                Permission flyout = new Permission();
                flyout.Title      = "Privacy Settings";
                flyout.Show();
            });

            args.Request.ApplicationCommands.Add(cmd2);

            //SettingsCommand cmd3 = new SettingsCommand("Setări", "Setări", (x) =>
            //{
            //    SettingsFlyout1 set = new SettingsFlyout1();
            //    set.Title = "Setări background";
            //    set.Show();
            //});
            //args.Request.ApplicationCommands.Add(cmd3);
        }
Пример #31
0
        void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            if (args.Request.ApplicationCommands.Count == 0)
            {
                // Add an About command
                var about = new SettingsCommand("about", _resourceLoader.GetString("AppBarAboutTitle"), (handler) =>
                {
                    var settings = new SettingsFlyout();
                    settings.ShowFlyout(new AboutUserControl());
                });
                args.Request.ApplicationCommands.Add(about);


                // Add an settings command
                var settingsCommand = new SettingsCommand("settings", _resourceLoader.GetString("AppBarSettingsTitle"), (handler) =>
                {
                    var settingsFlyout = new SettingsFlyout();
                    settingsFlyout.ShowFlyout(new SettingsUserControl());
                });
                args.Request.ApplicationCommands.Add(settingsCommand);

                // Add an privacy policy command
                var privacyCommand = new SettingsCommand("privacy", "Privacy Policy", (handler) =>
                {
                    var settingsFlyout = new SettingsFlyout();
                    settingsFlyout.ShowFlyout(new PrivacyPolicyControl());
                });
                args.Request.ApplicationCommands.Add(privacyCommand);
            }
        }
Пример #32
0
        public EngineCommand PollCommand(Bot bot)
        {
            var line = Console.ReadLine();

            if (string.IsNullOrWhiteSpace(line))
                return null;

            EngineCommand command = null;
            var parse = line.Split(' ');
            switch (parse[0])
            {
                case "settings":
                    command = new SettingsCommand(bot.MatchSettings, parse[1], parse[2]);
                    break;
                case "update":
                    if (parse[1] == "game")
                    {
                        command = new GameStateCommand(bot.GameState, parse[2], parse[3]);
                    }
                    else
                    {
                        if (bot.MatchSettings.PlayerNames.Contains(parse[1]))
                        {
                            if (!bot.Players.ContainsKey(parse[1]))
                            {
                                bot.Players.Add(parse[1], new PlayerState(bot.MatchSettings.FieldWidth, bot.MatchSettings.FieldHeight));
                            }

                            var player = bot.Players[parse[1]];
                            command = new PlayerCommand(player, parse[1], parse[2], parse[3]);
                        }
                        else
                        {
                            Console.WriteLine("Invalid player: '{0}'", parse[1]);
                        }
                    }
                    break;
                case "action":
                    command = new BotCommand(bot, parse[1], parse[2]);
                    break;
            }

            if (command == null)
            {
                Console.WriteLine("Invalid command: '{0}'", parse[0]);
            }

            return command;
        }
Пример #33
0
 private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
     var setting = new SettingsCommand("MySetting", "MySetting", handler =>
         new MySettingsFlyout().Show());
     args.Request.ApplicationCommands.Add(setting);
 }
Пример #34
0
 public List<Square> Update(SettingsCommand command, PlayerState player)
 {
     player.Color = command.Color;
       player.Name = command.Name;
       return new List<Square>();
 }