Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SubsettingExampleOriginIdentifier"/> class.
        /// </summary>
        public SubsettingExampleOriginIdentifier(IOriginIdentifier originIdentifier, ISubsetExampleOriginHelper subsetExampleOriginHelper)
        {
            if (!subsetExampleOriginHelper.OriginatesFromExampleDataSource(originIdentifier))
            {
                throw new ArgumentException("The specified origin is not from the subsetting example.");
            }

            // If either of these fails, then the structure of the information
            // is different from how it was originally specified in the example.
            Source = originIdentifier.Key.ElementAt(0);
            Id     = originIdentifier.Key.ElementAt(1);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SubsettingExampleOriginIdentifier"/> class.
        /// </summary>
        public SubsettingExampleOriginIdentifier(IOriginIdentifier originIdentifier, ISubsetExampleOriginHelper subsetExampleOriginHelper)
        {
            if (!subsetExampleOriginHelper.OriginatesFromExampleDataSource(originIdentifier))
            {
                throw new ArgumentException("The specified origin is not from the subsetting example.");
            }

            // If either of these fails, then the structure of the information
            // is different from how it was originally specified in the example.
            Source = originIdentifier.Key.ElementAt(0);
            Id = originIdentifier.Key.ElementAt(1);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemDetailsCommandProvider"/> class.
 /// </summary>
 /// <remarks>
 /// The constructor requires an implementation of ICommandContextState
 /// because ItemDetailsCommandProvider is used with
 /// IGenericContextMenuCommandProviderFactoryRegistry as a factory for
 /// creating commands based on ICommandsContext objects.
 /// </remarks>
 public ItemDetailsCommandProvider(
     ICommandsContext commandsContext, 
     ICommandContextState commandContextState, 
     IIntentManager intentManager,
     ISubsettingExampleOriginIdentifierFactory subsettingExampleOriginIdentifierFactory,
     ISubsetExampleOriginHelper subsetExampleOriginHelper)
 {
     mCommandsContext = commandsContext;
     mCommandContextState = commandContextState;
     mIntentManager = intentManager;
     mSubsettingExampleOriginIdentifierFactory = subsettingExampleOriginIdentifierFactory;
     mSubsetExampleOriginHelper = subsetExampleOriginHelper;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemDetailsCommandProvider"/> class.
 /// </summary>
 /// <remarks>
 /// The constructor requires an implementation of ICommandContextState
 /// because ItemDetailsCommandProvider is used with
 /// IGenericContextMenuCommandProviderFactoryRegistry as a factory for
 /// creating commands based on ICommandsContext objects.
 /// </remarks>
 public ItemDetailsCommandProvider(
     ICommandsContext commandsContext,
     ICommandContextState commandContextState,
     IIntentManager intentManager,
     ISubsettingExampleOriginIdentifierFactory subsettingExampleOriginIdentifierFactory,
     ISubsetExampleOriginHelper subsetExampleOriginHelper)
 {
     mCommandsContext     = commandsContext;
     mCommandContextState = commandContextState;
     mIntentManager       = intentManager;
     mSubsettingExampleOriginIdentifierFactory = subsettingExampleOriginIdentifierFactory;
     mSubsetExampleOriginHelper = subsetExampleOriginHelper;
 }