Skip to content

Commit 66e3c44

Browse files
committed
Source addition
1 parent 145909d commit 66e3c44

22 files changed

+243
-0
lines changed

GetAysnc_Methods.sln

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.31101.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetAysnc_Methods", "GetAysnc_Methods\GetAysnc_Methods.csproj", "{618E7A40-7F29-49DA-966B-F923889956AA}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{618E7A40-7F29-49DA-966B-F923889956AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{618E7A40-7F29-49DA-966B-F923889956AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{618E7A40-7F29-49DA-966B-F923889956AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{618E7A40-7F29-49DA-966B-F923889956AA}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

GetAysnc_Methods.v12.suo

40.5 KB
Binary file not shown.

GetAysnc_Methods/App.config

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{618E7A40-7F29-49DA-966B-F923889956AA}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>GetAysnc_Methods</RootNamespace>
11+
<AssemblyName>GetAysnc_Methods</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="Mono.Cecil">
37+
<HintPath>..\..\..\..\..\Downloads\cecil-master\bin\net_4_0_Debug\Mono.Cecil.dll</HintPath>
38+
</Reference>
39+
<Reference Include="System" />
40+
<Reference Include="System.Core" />
41+
<Reference Include="System.Xml.Linq" />
42+
<Reference Include="System.Data.DataSetExtensions" />
43+
<Reference Include="Microsoft.CSharp" />
44+
<Reference Include="System.Data" />
45+
<Reference Include="System.Xml" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<Compile Include="Program.cs" />
49+
<Compile Include="Properties\AssemblyInfo.cs" />
50+
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="App.config" />
53+
</ItemGroup>
54+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
55+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
56+
Other similar extension points exist, see Microsoft.Common.targets.
57+
<Target Name="BeforeBuild">
58+
</Target>
59+
<Target Name="AfterBuild">
60+
</Target>
61+
-->
62+
</Project>

GetAysnc_Methods/Program.cs

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using Mono;
6+
using Mono.Cecil;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
10+
namespace GetAysnc_Methods
11+
{
12+
13+
class Program
14+
{
15+
static List<string> _filelist = new List<string>();
16+
17+
static void Main(string[] args)
18+
{
19+
StringBuilder sb = new StringBuilder();
20+
21+
string loc = (args != null & args[0] !=null)? args[0] : @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\";
22+
string filepath = (args != null & args[1] != null) ? args[1] :@"c:\temp\list.txt";
23+
DirSearch(loc);
24+
_filelist.Sort();
25+
foreach (string fname in _filelist)
26+
{
27+
AssemblyDefinition a = null;
28+
try
29+
{
30+
a = AssemblyDefinition.ReadAssembly(fname);
31+
}
32+
catch (Exception e) { continue; }
33+
sb.Append(string.Join(Environment.NewLine, a.GetAsyncMethods().ToArray()));
34+
}
35+
File.WriteAllText(filepath, sb.ToString());
36+
}
37+
38+
static void DirSearch(string dir)
39+
{
40+
try
41+
{
42+
foreach (string f in Directory.GetFiles(dir, "*.dll")) { _filelist.Add(f); }
43+
foreach (string d in Directory.GetDirectories(dir)) { DirSearch(d); }
44+
}
45+
catch (System.Exception ex)
46+
{
47+
Console.WriteLine(ex.Message);
48+
}
49+
}
50+
}
51+
52+
static class GetMethod
53+
{
54+
public static List<string> GetAsyncMethods(this AssemblyDefinition assembly)
55+
{
56+
List<string> _methodnamelist = new List<string>();
57+
var modules = assembly.Modules;
58+
try
59+
{
60+
foreach (var module in modules)
61+
{
62+
foreach (var type in module.Types)
63+
{
64+
foreach (var method in type.Methods)
65+
{
66+
foreach (var att in method.CustomAttributes)
67+
{
68+
// AsyncStateMachineAttribute - This attribute is not available in all classes
69+
if (att.AttributeType.Name == "AsyncStateMachineAttribute" || method.Name.ToUpper().IndexOf("ASYNC", 0) > 0)
70+
{
71+
_methodnamelist.Add("\"" + module.Assembly.FullName + "\"," + type.Name + ", " + method.Name);
72+
continue;
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
79+
catch (Exception ex)
80+
{
81+
}
82+
83+
return _methodnamelist;
84+
}
85+
}
86+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("GetAysnc_Methods")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Microsoft")]
12+
[assembly: AssemblyProduct("GetAysnc_Methods")]
13+
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("abee74e6-bd10-4c7e-9112-99f56bf07809")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
17.5 KB
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
5+
</startup>
6+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3+
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
4+
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
5+
<security>
6+
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
7+
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
8+
</requestedPrivileges>
9+
</security>
10+
</trustInfo>
11+
</assembly>
315 KB
Binary file not shown.
1.13 MB
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\bin\Debug\GetAysnc_Methods.exe.config
2+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\obj\Debug\GetAysnc_Methods.csprojResolveAssemblyReference.cache
3+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\bin\Debug\GetAysnc_Methods.exe
4+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\bin\Debug\GetAysnc_Methods.pdb
5+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\obj\Debug\GetAysnc_Methods.exe
6+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\obj\Debug\GetAysnc_Methods.pdb
7+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\bin\Debug\Mono.Cecil.dll
8+
c:\users\chinnraj\documents\visual studio 2013\Projects\GetAysnc_Methods\GetAysnc_Methods\bin\Debug\Mono.Cecil.pdb
Binary file not shown.
Binary file not shown.
17.5 KB
Binary file not shown.

GetAysnc_Methods/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Whitespace-only changes.

GetAysnc_Methods/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Whitespace-only changes.

GetAysnc_Methods/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

Whitespace-only changes.

0 commit comments

Comments
 (0)