当前位置: 首页>>代码示例>>C#>>正文


C# IUICommand类代码示例

本文整理汇总了C#中IUICommand的典型用法代码示例。如果您正苦于以下问题:C# IUICommand类的具体用法?C# IUICommand怎么用?C# IUICommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IUICommand类属于命名空间,在下文中一共展示了IUICommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConnectToServiceAsync

 private async Task ConnectToServiceAsync(IUICommand command)
 {
     DeviceInformation serviceInfo = (DeviceInformation)command.Id;
     this.State = BluetoothConnectionState.Connecting;
     try
     {
         // Initialize the target Bluetooth RFCOMM device service
         connectService = RfcommDeviceService.FromIdAsync(serviceInfo.Id);
         rfcommService = await connectService;
         if (rfcommService != null)
         {
             // Create a socket and connect to the target 
             socket = new StreamSocket();
             connectAction = socket.ConnectAsync(rfcommService.ConnectionHostName, rfcommService.ConnectionServiceName, SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);
             await connectAction;//to make it cancellable
             writer = new DataWriter(socket.OutputStream);
             reader = new DataReader(socket.InputStream);
             Task listen = ListenForMessagesAsync();
             this.State = BluetoothConnectionState.Connected;
         }
         else
             OnExceptionOccuredEvent(this, new Exception("Unable to create service.\nMake sure that the 'bluetooth.rfcomm' capability is declared with a function of type 'name:serialPort' in Package.appxmanifest."));
     }
     catch (TaskCanceledException)
     {
         this.State = BluetoothConnectionState.Disconnected;
     }
     catch (Exception ex)
     {
         this.State = BluetoothConnectionState.Disconnected;
         OnExceptionOccuredEvent(this, ex);
     }
 }
开发者ID:spacemishka,项目名称:SparkiController,代码行数:33,代码来源:BluetoothConnectionManager.cs

示例2: YesBtnClick

        private void YesBtnClick(IUICommand command)
        {
            Code c = new Code();
            c.CPRStartTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, int.Parse(txtHour.Text), int.Parse(txtMinute.Text), 0);

            this.Frame.Navigate(typeof(HomePage), c);
        }
开发者ID:KalAcademyNP,项目名称:CodeKeeper,代码行数:7,代码来源:MainPage.xaml.cs

示例3: startTutorial

 private static void startTutorial(IUICommand command)
 {
     //if (mapView.Frame != null)
     //{
     //    mapView.Frame.Navigate(typeof(View.TutorialView));
     //}
 }
开发者ID:Tmutsaers,项目名称:HierInBreda,代码行数:7,代码来源:MainControl.cs

示例4: OnSetGameType

 private void OnSetGameType(IUICommand command)
 {
     if (command.Label.Equals("Two player"))
         playerX.IsPerson = true;
     else
         playerX.IsPerson = false;
 }
开发者ID:EDLuke,项目名称:MetroTicTacToe,代码行数:7,代码来源:TicTacToeGame.cs

示例5: OnSettingsCommandInvoker

        private void OnSettingsCommandInvoker(IUICommand command)
        {
            settingsPopup = new Popup();
            settingsPopup.Closed += SettingsPopupOnClosed;
            Window.Current.Activated += OnWindowActivated;
            settingsPopup.IsLightDismissEnabled = true;
            settingsPopup.Width = settingsWidth;
            settingsPopup.Height = windowBounds.Height;

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

            // Create a SettingsFlyout the same dimenssions as the Popup.
            var mypane = new SettingsFlyoutPage
            {
                DataContext = this.Settings
            };

            mypane.Width = settingsWidth;
            mypane.Height = windowBounds.Height;

            settingsPopup.Child = mypane;

            settingsPopup.SetValue(Canvas.LeftProperty, SettingsPane.Edge == SettingsEdgeLocation.Right ? (windowBounds.Width - settingsWidth) : 0);
            settingsPopup.SetValue(Canvas.TopProperty, 0);
            settingsPopup.IsOpen = true;            
        }
开发者ID:derikwhittaker,项目名称:LiveLessons.WinRT,代码行数:32,代码来源:DashboardViewModel.cs

示例6: onSettingsCommand

 void onSettingsCommand(IUICommand command)
 {
     // TODO 2.3: execute the corresponding setting
     //           --> usually based on the SettingsCommand.Id value
     SettingsCommand settingsCommand = (SettingsCommand)command;
     rootPage.NotifyUser("You selected the " + settingsCommand.Label + " settings command", NotifyType.StatusMessage);
 }
开发者ID:jkuemerle,项目名称:CodeMash2013,代码行数:7,代码来源:AddSettingsScenario.xaml.cs

示例7: Save_Popup_Yes

 private async void Save_Popup_Yes(IUICommand command)
 {
     var viewModel = DataContext as CreateOrderPageViewModel;
     Tuple<bool,string> answer = viewModel.SaveOrder();
     if (answer.Item1 == false) CreateAndShowMessageDialog(answer.Item2);
     Frame.Navigate(typeof(OrderPage));
 }
开发者ID:PeterOeClausen,项目名称:Bachelorproject,代码行数:7,代码来源:CreateOrderPage.xaml.cs

示例8: OpenStoreRating

 private async void OpenStoreRating(IUICommand command)
 {
     string name = Package.Current.Id.FamilyName;
     await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:REVIEW?PFN=" + name));
     //await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:REVIEW?PFN=6b7b722b-a69d-42fc-8fba-f1b30776edec"));
     //SaveAppRatingSetting();
 }
开发者ID:MohamedELSaQeR,项目名称:My-Apps,代码行数:7,代码来源:MainPage.xaml.cs

示例9: CommandInvokedHandler

 private static async void CommandInvokedHandler(IUICommand command)
 {
     if (command.Label == Utils.Utils.ResourceLoader.GetString("Text_Review"))
     {
         await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:reviewapp?appid=" + CurrentApp.AppId));
     }
 }
开发者ID:Speedydown,项目名称:Thirty_Seconds_WP,代码行数:7,代码来源:RatingHandler.cs

示例10: HandlePrivacyPolocySettingsCommand

 private void HandlePrivacyPolocySettingsCommand(IUICommand command)
 {
     var settings = new SettingsFlyout();
     settings.Content = new PrivacyPolicySettingsView();
     settings.HeaderText = "Privacy Policy";
     settings.IsOpen = true;
 }
开发者ID:BlueForeverI,项目名称:INeedHelp.Client,代码行数:7,代码来源:App.xaml.cs

示例11: OnAboutCommand

        private void OnAboutCommand(IUICommand command)
        {
            SettingsPopup = new Popup();
            SettingsPopup.IsLightDismissEnabled = true;
            SettingsPopup.Width = SettingsWidth;
            SettingsPopup.Height = WindowBounds.Height;

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

            var mypane = new AboutFlyout { Width = SettingsWidth, Height = WindowBounds.Height };

            SettingsPopup.Child = mypane;

            SettingsPopup.SetValue(Canvas.LeftProperty,
                                    SettingsPane.Edge == SettingsEdgeLocation.Right
                                        ? (WindowBounds.Width - SettingsWidth)
                                        : 0);
            SettingsPopup.SetValue(Canvas.TopProperty, 0);
            SettingsPopup.IsOpen = true;
        }
开发者ID:rousse101,项目名称:WritePadSDK,代码行数:28,代码来源:SettingsUI.cs

示例12: CommandInvokedHandler

 private async void CommandInvokedHandler(IUICommand command)
 {
     if (command.Id.ToString() == "0")
     {
         await Execute();
     }
 }
开发者ID:Prog-Party,项目名称:ProgParty.BoredPanda,代码行数:7,代码来源:Review.cs

示例13: CommandInvokedHandler

 static private async void CommandInvokedHandler(IUICommand command)
 {
     messageShown = false;
     if (command.Label == "Submit Feedback")
     {
         await Windows.System.Launcher.LaunchUriAsync(new Uri("mailto:kyle.de[email protected]?subject=HudlRT%20Feedback"));
     }
 }
开发者ID:jwiese-ms,项目名称:hudl-win8,代码行数:8,代码来源:APIExceptionDialog.cs

示例14: About_Click

 private void About_Click(IUICommand cmd) {
     SettingsFlyout settings = new SettingsFlyout();
     settings.Background = new SolidColorBrush(Colors.White);
     settings.HeaderBrush = new SolidColorBrush(Colors.Black);
     settings.Content = new AboutPanel();
     settings.HeaderText = "About";
     settings.IsOpen = true;
     RestoreCursor(); }
开发者ID:Razmal,项目名称:libmpeg2-winrt,代码行数:8,代码来源:App.xaml.cs

示例15: CommandInvokedHandler

 private void CommandInvokedHandler(IUICommand command)
 {
     if (command.Label == "Delete")
     {
         App.DataModel.DeleteNote(note);
         Frame.Navigate(typeof(SeeHistory));
     }
 }
开发者ID:IagoAleksander,项目名称:Money-note,代码行数:8,代码来源:NoteDetails.xaml.cs


注:本文中的IUICommand类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。