예제 #1
0
 public static ConnectCommand Create(CommandContent model)
 {
     return(new ConnectCommand()
     {
         ContentT = model
     });
 }
예제 #2
0
 public GetUriResponse?GetUri(CommandContent commandContent)
 {
     if (commandContent is SimpleContentCommand uri)
     {
         return(Commands.Get(uri.Command));
     }
     return(null);
 }
예제 #3
0
 public GetUriResponse?GetUri(CommandContent commandContent)
 {
     if (commandContent is AssetGoCommand command)
     {
         return("/View/Asset/AssetLanding.xaml?" + command.Asset.ShortCode);
     }
     return(null);
 }
예제 #4
0
        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            // TODO: Create an appropriate data model for your problem domain to replace the sample data.
            var commandInformation = (string)e.NavigationParameter;

            commandName = commandInformation.Substring(4);
            string commandClass = commandInformation.Substring(0, 4);

            CommandName.Text = commandName;
            CommandContent.Navigate(new Uri("ms-appx-web:///Commands/" + commandClass + "/" + commandName + ".html"));

            checkIfFavorite();
        }
예제 #5
0
        /// <summary>
        /// Populates the page with content passed during navigation. Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>.
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            // TODO: Create an appropriate data model for your problem domain to replace the sample data.
            //var command = (Command)e.NavigationParameter;
            //CommandName.Text = command.CommandName;
            //string commandSource = "ms-appx-web:///Commands/" + command.ClassName + "/" + command.CommandName + ".html";

            //CommandContent.Navigate(new Uri(commandSource));


            CommandName.Text = "ar";
            CommandContent.Navigate(new Uri("ms-appx-web:///Commands/" + "bfys" + "/ar" + ".html"));
        }
예제 #6
0
        public bool Check(CommandContent content)
        {
            if (content.AlexaCommandContent?.IntentName != null)
            {
                return(IntentName == content.AlexaCommandContent.IntentName);
            }

            if (Slots == null || content.AlexaCommandContent?.Slots == null)
            {
                return(false);
            }

            return(content.AlexaCommandContent.Slots.Keys.All(key => Slots.ContainsKey(key)));
        }
예제 #7
0
        public StarViewModel(DocumentPaneViewModel paneVm)
        {
            _paneVm      = paneVm;
            _context     = UserContext.Current;
            _paneCommand = _paneVm.GetPageCommand();

            _messenger.RegisterAsync <BookmarkHasChangedMessage>(this, _context.Token, SetBookmarkedState);
            _messenger.RegisterAsync <BookmarkStatusResponseMessage>(this, _context.Token, SetBookmarkedState);

            _messenger.SendAsync <BookmarkStatusRequestMessage>(new BookmarkStatusRequestMessage(_paneCommand), _context.Token);

            ClickBookmarkCommand = new RelayCommand(() =>
            {
                //IsBookmarked responds to clicks, and will be reflect that after-clicked state.
                _messenger.SendAsync(new BookmarkSetMessage(_paneCommand, IsBookmarked), _context.Token);
            });

            IsEnabled = true;
        }
예제 #8
0
 protected BookmarkMessageBase(CommandContent bookmark, bool isBookmarked)
 {
     Bookmark     = bookmark;
     IsBookmarked = isBookmarked;
 }
 public BookmarkStatusRequestMessage(CommandContent bookmark)
 {
     Bookmark = bookmark;
 }
예제 #10
0
 public BookmarkHasChangedMessage(CommandContent bookmark, bool isBookmarked) : base(bookmark, isBookmarked)
 {
 }
 public BookmarkStatusResponseMessage(CommandContent bookmark, bool isBookmarked) : base(bookmark, isBookmarked)
 {
 }
예제 #12
0
 private void Parse()
 {
     this.commandNameEndIndex = this.GetCommandNameEndIndex();
     this.Name = this.ParseName();
     this.Parameters = this.ParseParameters();
     this.TrimParams();
     this.Type = this.ParseCommandType(this.Name);
 }
예제 #13
0
 public BookmarkSetMessage(CommandContent bookmark, bool isBookmarked) : base(bookmark, isBookmarked)
 {
 }
예제 #14
0
 public bool Check(CommandContent content)
 {
     return(content.AliceCommandContent?.Keywords != null &&
            Utils.CheckTokens(Tokens, content.AliceCommandContent.Keywords.ToArray()));
 }