Exemplo n.º 1
0
 /// <summary>
 /// Checks that given a certain <see cref="CompositeMethodVisiblity"/>, given <see cref="System.Reflection.MethodInfo"/> may be considered as composite method.
 /// </summary>
 /// <param name="visibility">The <see cref="CompositeMethodVisiblity"/>.</param>
 /// <param name="method">The <see cref="System.Reflection.MethodInfo"/> to check.</param>
 /// <returns><c>true</c> if given a <paramref name="visibility"/>, the <paramref name="method"/> should be considered as composite method; <c>false</c> otherwise.</returns>
 public static Boolean MethodConsideredToBeCompositeMethod(this CompositeMethodVisiblity visibility, System.Reflection.MethodInfo method)
 {
     return((visibility.IsPublic() && method.IsPublic) ||
            (visibility.IsInternal() && method.IsAssembly) ||
            (visibility.IsProtected() && method.IsFamily) ||
            (visibility.IsProtectedOrInternal() && method.IsFamilyOrAssembly) ||
            (visibility.IsProtectedAndInternal() && method.IsFamilyAndAssembly));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new instance of <see cref="DefaultCompositeMethodVisibilityAttribute"/> with given <see cref="Model.CompositeMethodVisiblity"/> flags.
 /// </summary>
 /// <param name="visibility">The ORed combination of composite method visibility flags.</param>
 public DefaultCompositeMethodVisibilityAttribute(CompositeMethodVisiblity visibility)
 {
     this._visibility = visibility;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Checks whether given <see cref="CompositeMethodVisiblity"/> has <see cref="CompositeMethodVisiblity.ProtectedAndInternal"/> flag set.
 /// </summary>
 /// <param name="visibility">The <see cref="CompositeMethodVisiblity"/>.</param>
 /// <returns><c>true</c> if <paramref name="visibility"/> has <see cref="CompositeMethodVisiblity.ProtectedAndInternal"/> flag set; <c>false</c> otherwise.</returns>
 public static Boolean IsProtectedAndInternal(this CompositeMethodVisiblity visibility)
 {
     return((visibility & CompositeMethodVisiblity.ProtectedAndInternal) != 0);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Checks whether given <see cref="CompositeMethodVisiblity"/> has <see cref="CompositeMethodVisiblity.Public"/> flag set.
 /// </summary>
 /// <param name="visibility">The <see cref="CompositeMethodVisiblity"/>.</param>
 /// <returns><c>true</c> if <paramref name="visibility"/> has <see cref="CompositeMethodVisiblity.Public"/> flag set; <c>false</c> otherwise.</returns>
 public static Boolean IsPublic(this CompositeMethodVisiblity visibility)
 {
     return((visibility & CompositeMethodVisiblity.Public) != 0);
 }