/// <summary>
 /// Determines whether this instance [can be deployed using feature] the specified supported scopes.
 /// </summary>
 /// <param name="supportedScopes">The supported scopes.</param>
 /// <returns>
 ///     <c>true</c> if this instance [can be deployed using feature] the specified supported scopes; otherwise, <c>false</c>.
 /// </returns>
 private static bool CanBeDeployedUsingFeature(SupportedDeploymentScopes supportedScopes)
 {
     return((supportedScopes & SupportedDeploymentScopes.Farm) == SupportedDeploymentScopes.Farm ||
            (supportedScopes & SupportedDeploymentScopes.Site) == SupportedDeploymentScopes.Site ||
            (supportedScopes & SupportedDeploymentScopes.Web) == SupportedDeploymentScopes.Web ||
            (supportedScopes & SupportedDeploymentScopes.WebApplication) == SupportedDeploymentScopes.WebApplication);
 }
Exemple #2
0
        /// <summary>
        /// Features the supports spi scope.
        /// </summary>
        /// <param name="featureScope">The feature scope.</param>
        /// <param name="supportedDeploymentScopes">The supported deployment scopes.</param>
        /// <returns></returns>
        private static bool FeatureSupportsSpiScope(Microsoft.VisualStudio.SharePoint.Features.FeatureScope featureScope,
                                                    SupportedDeploymentScopes supportedDeploymentScopes)
        {
            bool featureSupportsSpiScope = false;

            switch (featureScope)
            {
            case Microsoft.VisualStudio.SharePoint.Features.FeatureScope.Farm:
                featureSupportsSpiScope = (supportedDeploymentScopes & SupportedDeploymentScopes.Farm) == SupportedDeploymentScopes.Farm;
                break;

            case Microsoft.VisualStudio.SharePoint.Features.FeatureScope.Site:
                featureSupportsSpiScope = (supportedDeploymentScopes & SupportedDeploymentScopes.Site) == SupportedDeploymentScopes.Site;
                break;

            case Microsoft.VisualStudio.SharePoint.Features.FeatureScope.Web:
                featureSupportsSpiScope = (supportedDeploymentScopes & SupportedDeploymentScopes.Web) == SupportedDeploymentScopes.Web;
                break;

            case Microsoft.VisualStudio.SharePoint.Features.FeatureScope.WebApplication:
                featureSupportsSpiScope = (supportedDeploymentScopes & SupportedDeploymentScopes.WebApplication) == SupportedDeploymentScopes.WebApplication;
                break;
            }

            return(featureSupportsSpiScope);
        }
 /// <summary>
 /// Supportses the deployment scope.
 /// </summary>
 /// <param name="supportedScopes">The supported scopes.</param>
 /// <param name="scope">The scope.</param>
 /// <returns></returns>
 private static bool SupportsDeploymentScope(SupportedDeploymentScopes supportedScopes,
                                             SupportedDeploymentScopes scope)
 {
     return((supportedScopes & scope) == scope);
 }