Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthorizationDecisionListViewItem"/> class.
 /// </summary>
 /// <param name="authorizedItem">Name of the authorized item.</param>
 /// <param name="authorizationDecision"><see cref="AuthorizationDecision"/> object describing authorization decision
 /// response received for the authorized item.</param>
 public AuthorizationDecisionListViewItem(string authorizedItem, AuthorizationDecision authorizationDecision)
     : base(new string[] { authorizedItem, authorizationDecision[authorizedItem]?.ToString(), authorizationDecision.ToString() })
 {
     AuthorizedItem        = authorizedItem;
     Granted               = authorizationDecision[authorizedItem] != null && (bool)authorizationDecision[authorizedItem];
     AuthorizationDecision = authorizationDecision;
 }
        /// <summary>
        /// Adds an item for the received <see cref="AuthorizationDecision"/> in the list view.
        /// </summary>
        /// <param name="authorizedItem">Name of the authorized item.</param>
        /// <param name="authorizationDecision"><see cref="AuthorizationDecision"/> object describing authorization decision
        /// response received for the authorized item.</param>
        private void ShowAuthorizationDecision(string authorizedItem, AuthorizationDecision authorizationDecision)
        {
            var authorizationDecisionItem = BuildAuthorizationDecisionItem(authorizedItem, authorizationDecision);

            AuthorizationDecisionItems.Add(authorizationDecisionItem);
            RaisePropertyChanged("AuthorizationDecisionItems");
        }
Пример #3
0
 /// <summary>
 /// Builds a <see cref="ListViewItem"/> for displaying an <see cref="AuthorizationDecision"/> in the list view.
 /// </summary>
 /// <param name="authorizedItem">Name of the authorized item.</param>
 /// <param name="authorizationDecision"><see cref="AuthorizationDecision"/> object describing authorization decision
 /// response received for the authorized item.</param>
 /// <returns>The <see cref="ListViewItem"/>.</returns>
 private ListViewItem BuildListViewItemForAuthorizationDecision(string authorizedItem, AuthorizationDecision authorizationDecision)
 {
     return(new AuthorizationDecisionListViewItem(authorizedItem, authorizationDecision));
 }
Пример #4
0
        /// <summary>
        /// Adds an item for the received <see cref="AuthorizationDecision"/> in the list view.
        /// </summary>
        /// <param name="authorizedItem">Name of the authorized item.</param>
        /// <param name="authorizationDecision"><see cref="AuthorizationDecision"/> object describing authorization decision
        /// response received for the authorized item.</param>
        private void ShowAuthorizationDecision(string authorizedItem, AuthorizationDecision authorizationDecision)
        {
            var authorizationDecisionItem = BuildListViewItemForAuthorizationDecision(authorizedItem, authorizationDecision);

            listViewAuthorizationDecisions.Items.Add(authorizationDecisionItem);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AuthorizationDecisionItem"/> class.
 /// </summary>
 /// <param name="authorizedItem">Name of the authorized item.</param>
 /// <param name="authorizationDecision"><see cref="AuthorizationDecision"/> object describing authorization decision
 /// response received for the authorized item.</param>
 public AuthorizationDecisionItem(string authorizedItem, AuthorizationDecision authorizationDecision)
 {
     AuthorizedItem        = authorizedItem;
     Granted               = authorizationDecision[authorizedItem] != null && (bool)authorizationDecision[authorizedItem];
     AuthorizationDecision = authorizationDecision;
 }
 /// <summary>
 /// Builds a <see cref="AuthorizationDecisionItem"/> for displaying an <see cref="AuthorizationDecision"/> in the list view.
 /// </summary>
 /// <param name="authorizedItem">Name of the authorized item.</param>
 /// <param name="authorizationDecision"><see cref="AuthorizationDecision"/> object describing authorization decision
 /// response received for the authorized item.</param>
 /// <returns>The <see cref="ListViewItem"/>.</returns>
 private AuthorizationDecisionItem BuildAuthorizationDecisionItem(string authorizedItem, AuthorizationDecision authorizationDecision)
 {
     return(new AuthorizationDecisionItem(authorizedItem, authorizationDecision));
 }