예제 #1
0
 private static void RemoveAsyncMethods(CodeTypeDeclaration callbackInterface)
 {
     CollectionHelpers.MapList <CodeMemberMethod>(
         callbackInterface.Members,
         delegate(CodeMemberMethod method)
     {
         return(!CodeDomHelpers.IsTaskAsyncMethod(method));
     },
         null
         );
 }
예제 #2
0
        protected override void VisitAttributedType(CodeTypeDeclaration type)
        {
            base.VisitAttributedType(type);

            CollectionHelpers.MapList <CodeMemberMethod>(
                type.Members,
                delegate(CodeMemberMethod method)
            {
                return(CodeDomHelpers.IsBeginMethod(method) ||
                       CodeDomHelpers.IsTaskAsyncMethod(method) ||
                       CodeDomHelpers.IsEndMethod(method));
            },
                this.CopyAttrsToTaskAsyncMethod
                );
        }
        protected override void VisitClientClass(CodeTypeDeclaration type)
        {
            base.VisitClientClass(type);

            CollectionHelpers.MapList <CodeMemberMethod>(
                type.Members,
                delegate(CodeMemberMethod method)
            {
                return(method is CodeConstructor ||
                       CodeDomHelpers.IsBeginMethod(method) ||
                       CodeDomHelpers.IsEndMethod(method) ||
                       CodeDomHelpers.IsTaskAsyncMethod(method));
            },
                null
                );
        }
예제 #4
0
 internal static CodeMemberMethod GetTaskAsyncMethodForMethod(CodeTypeMemberCollection members, CodeMemberMethod method)
 {
     return(CodeDomHelpers.IsTaskAsyncMethod(method) ? method : CodeDomHelpers.FindMethodByName(members, CodeDomHelpers.GetMethodNameBase(method) + "Async"));
 }