diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/PostSharp.Samples.DependencyResolution.Contextual.Test.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/PostSharp.Samples.DependencyResolution.Contextual.Test.csproj new file mode 100644 index 0000000..766fe77 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/PostSharp.Samples.DependencyResolution.Contextual.Test.csproj @@ -0,0 +1,82 @@ + + + + + + + Debug + AnyCPU + {232F6D41-893E-4526-9C4A-94C57EF12B6F} + Library + Properties + PostSharp.Samples.DependencyResolution.Contextual.Test + PostSharp.Samples.DependencyResolution.Contextual.Test + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + {9dfd9bdb-fb8b-4066-a62e-670c20ce1213} + PostSharp.Samples.DependencyResolution.Contextual + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..917667c --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.Contextual.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.Contextual.Test")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("232f6d41-893e-4526-9c4a-94c57ef12b6f")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/TestLogAspect.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/TestLogAspect.cs new file mode 100644 index 0000000..73fc16c --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/TestLogAspect.cs @@ -0,0 +1,51 @@ +using System; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace PostSharp.Samples.DependencyResolution.Contextual.Test +{ + [TestClass] + public class TestLogAspect + { + [TestMethod] + public void TestMethod() + { + // The ServiceLocator can be initialized for each test. + using ( + AspectServiceLocator.AddRule( + (type, member) => + type == typeof(LogAspect) && member.Name == "TargetMethod" ? new TestLogger() : null) + ) + { + TestLogger.Clear(); + TargetMethod(); + Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog()); + } + } + + [LogAspect] + public void TargetMethod() + { + } + } + + internal class TestLogger : ILogger + { + public static readonly StringBuilder stringBuilder = new StringBuilder(); + + public void Log(string message) + { + stringBuilder.AppendLine(message); + } + + public static string GetLog() + { + return stringBuilder.ToString(); + } + + public static void Clear() + { + stringBuilder.Clear(); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/packages.config new file mode 100644 index 0000000..6dec090 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual.Test/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/App.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/PostSharp.Samples.DependencyResolution.Contextual.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/PostSharp.Samples.DependencyResolution.Contextual.csproj new file mode 100644 index 0000000..72ad117 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/PostSharp.Samples.DependencyResolution.Contextual.csproj @@ -0,0 +1,69 @@ + + + + + + Debug + AnyCPU + {9DFD9BDB-FB8B-4066-A62E-670C20CE1213} + Exe + PostSharp.Samples.DependencyResolution.Contextual + PostSharp.Samples.DependencyResolution.Contextual + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/Program.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/Program.cs new file mode 100644 index 0000000..fb68253 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/Program.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition.Primitives; +using System.Reflection; +using PostSharp.Aspects; +using PostSharp.Extensibility; +using PostSharp.Serialization; + +namespace PostSharp.Samples.DependencyResolution.Contextual +{ + public interface ILogger + { + void Log(string message); + } + + public static class AspectServiceLocator + { + private static CompositionContainer container; + private static HashSet rules = new HashSet(); + + public static void Initialize(ComposablePartCatalog catalog) + { + container = new CompositionContainer(catalog); + } + + public static Lazy GetService(Type aspectType, MemberInfo targetElement) where T : class + { + return new Lazy(() => GetServiceImpl(aspectType, targetElement)); + } + + private static T GetServiceImpl(Type aspectType, MemberInfo targetElement) where T : class + { + // The rule implementation is naive but this is for testing purpose only. + foreach (object rule in rules) + { + DependencyRule typedRule = rule as DependencyRule; + if (typedRule == null) continue; + + T service = typedRule.Rule(aspectType, targetElement); + if (service != null) return service; + } + + if (container == null) + throw new InvalidOperationException(); + + // Fallback to the container, which should be the default and production behavior. + return container.GetExport().Value; + } + + public static IDisposable AddRule(Func rule) + { + DependencyRule dependencyRule = new DependencyRule(rule); + rules.Add(dependencyRule); + return dependencyRule; + } + + private class DependencyRule : IDisposable + { + public DependencyRule(Func rule) + { + this.Rule = rule; + } + + public Func Rule { get; private set; } + + public void Dispose() + { + rules.Remove(this); + } + } + } + + [PSerializable] + public class LogAspect : OnMethodBoundaryAspect + { + private Lazy logger; + + + public override void RuntimeInitialize(MethodBase method) + { + logger = AspectServiceLocator.GetService(this.GetType(), method); + } + + + public override void OnEntry(MethodExecutionArgs args) + { + logger.Value.Log("OnEntry"); + } + } + + internal class Program + { + private static void Main(string[] args) + { + AspectServiceLocator.Initialize(new TypeCatalog(typeof(ConsoleLogger))); + + LoggedMethod(); + + Console.ReadLine(); + } + + [LogAspect] + public static void LoggedMethod() + { + Console.WriteLine("Hello, world."); + } + } + + + [Export(typeof(ILogger))] + internal class ConsoleLogger : ILogger + { + public void Log(string message) + { + Console.WriteLine(message); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b897871 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.Contextual")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.Contextual")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9dfd9bdb-fb8b-4066-a62e-670c20ce1213")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/packages.config new file mode 100644 index 0000000..e9ff227 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/PostSharp.Samples.DependencyResolution.Dynamic.Test.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/PostSharp.Samples.DependencyResolution.Dynamic.Test.csproj new file mode 100644 index 0000000..311c930 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/PostSharp.Samples.DependencyResolution.Dynamic.Test.csproj @@ -0,0 +1,82 @@ + + + + + + + Debug + AnyCPU + {C7F763E3-29BD-44F6-B8F6-1EEDC3D19932} + Library + Properties + PostSharp.Samples.DependencyResolution.Dynamic.Test + PostSharp.Samples.DependencyResolution.Dynamic.Test + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + {de06ee91-aa77-43a4-b3cb-f21edafac25f} + PostSharp.Samples.DependencyResolution.Dynamic + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e88fd96 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.Dynamic.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.Dynamic.Test")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("c7f763e3-29bd-44f6-b8f6-1eedc3d19932")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/TestLogAspect.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/TestLogAspect.cs new file mode 100644 index 0000000..e0b47a6 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/TestLogAspect.cs @@ -0,0 +1,50 @@ +using System; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace PostSharp.Samples.DependencyResolution.Dynamic.Test +{ + [TestClass] + public class TestLogAspect + { + [TestMethod] + public void TestMethod() + { + // The ServiceLocator can be initialized for each test. + AspectServiceLocator.Initialize(new TypeCatalog(typeof(TestLogger)), false); + + TestLogger.Clear(); + TargetMethod(); + Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog()); + } + + + [LogAspect] + private void TargetMethod() + { + } + } + + [Export(typeof(ILogger))] + internal class TestLogger : ILogger + { + public static readonly StringBuilder stringBuilder = new StringBuilder(); + + public void Log(string message) + { + stringBuilder.AppendLine(message); + } + + public static string GetLog() + { + return stringBuilder.ToString(); + } + + public static void Clear() + { + stringBuilder.Clear(); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/packages.config new file mode 100644 index 0000000..6dec090 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic.Test/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/App.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/PostSharp.Samples.DependencyResolution.Dynamic.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/PostSharp.Samples.DependencyResolution.Dynamic.csproj new file mode 100644 index 0000000..b92eec1 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/PostSharp.Samples.DependencyResolution.Dynamic.csproj @@ -0,0 +1,69 @@ + + + + + + Debug + AnyCPU + {DE06EE91-AA77-43A4-B3CB-F21EDAFAC25F} + Exe + PostSharp.Samples.DependencyResolution.Dynamic + PostSharp.Samples.DependencyResolution.Dynamic + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/Program.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/Program.cs new file mode 100644 index 0000000..b22ef30 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/Program.cs @@ -0,0 +1,98 @@ +using System; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition.Primitives; +using PostSharp.Aspects; +using PostSharp.Extensibility; +using PostSharp.Serialization; + +namespace PostSharp.Samples.DependencyResolution.Dynamic +{ + public interface ILogger + { + void Log(string message); + } + + public static class AspectServiceLocator + { + private static CompositionContainer container; + private static bool isCacheable; + + public static void Initialize(ComposablePartCatalog catalog, bool isCacheable) + { + if (AspectServiceLocator.isCacheable && container != null) + throw new InvalidOperationException(); + + container = new CompositionContainer(catalog); + AspectServiceLocator.isCacheable = isCacheable; + } + + public static Func GetService() where T : class + { + if (isCacheable) + { + return () => new Lazy(GetServiceImpl).Value; + } + else + { + return GetServiceImpl; + } + } + + private static T GetServiceImpl() + { + if (container == null) + throw new InvalidOperationException(); + + return container.GetExport().Value; + } + } + + [PSerializable] + public class LogAspect : OnMethodBoundaryAspect + { + private static readonly Func logger; + + static LogAspect() + { + if (!PostSharpEnvironment.IsPostSharpRunning) + { + logger = AspectServiceLocator.GetService(); + } + } + + + public override void OnEntry(MethodExecutionArgs args) + { + logger().Log("OnEntry"); + } + } + + internal class Program + { + private static void Main(string[] args) + { + AspectServiceLocator.Initialize(new TypeCatalog(typeof(ConsoleLogger)), true); + + LoggedMethod(); + + Console.ReadLine(); + } + + [LogAspect] + public static void LoggedMethod() + { + Console.WriteLine("Hello, world."); + } + } + + + [Export(typeof(ILogger))] + internal class ConsoleLogger : ILogger + { + public void Log(string message) + { + Console.WriteLine(message); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f971960 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.Dynamic")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.Dynamic")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("de06ee91-aa77-43a4-b3cb-f21edafac25f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/packages.config new file mode 100644 index 0000000..e9ff227 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test.csproj new file mode 100644 index 0000000..9014c79 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test.csproj @@ -0,0 +1,82 @@ + + + + + + + Debug + AnyCPU + {7600D5FB-8111-4170-A1DC-F9E060179D50} + Library + Properties + PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test + PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + {e2051672-b2c6-45a1-b2be-411f483c667f} + PostSharp.Samples.DependencyResolution.GlobalServiceContainer + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..55b5ae0 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("7600d5fb-8111-4170-a1dc-f9e060179d50")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/TestLogAspect.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/TestLogAspect.cs new file mode 100644 index 0000000..5c57c28 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/TestLogAspect.cs @@ -0,0 +1,54 @@ +using System; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test +{ + [TestClass] + public class TestLogAspect + { + static TestLogAspect() + { + AspectServiceInjector.Initialize(new TypeCatalog(typeof(TestLogger))); + } + + [TestMethod] + public void TestMethod() + { + TestLogger.Clear(); + new TargetClass().TargetMethod(); + Assert.AreEqual("OnEntry" + Environment.NewLine + "OnSuccess" + Environment.NewLine + "OnExit" + Environment.NewLine, TestLogger.GetLog()); + } + + private class TargetClass + { + [LogAspect] + public void TargetMethod() + { + } + } + } + + [Export(typeof(ILogger))] + internal class TestLogger : ILogger + { + public static readonly StringBuilder stringBuilder = new StringBuilder(); + + public void Log(string message) + { + stringBuilder.AppendLine(message); + } + + public static string GetLog() + { + return stringBuilder.ToString(); + } + + public static void Clear() + { + stringBuilder.Clear(); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/packages.config new file mode 100644 index 0000000..6dec090 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/App.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.csproj new file mode 100644 index 0000000..d947d4a --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/PostSharp.Samples.DependencyResolution.GlobalServiceContainer.csproj @@ -0,0 +1,69 @@ + + + + + + Debug + AnyCPU + {E2051672-B2C6-45A1-B2BE-411F483C667F} + Exe + PostSharp.Samples.DependencyResolution.GlobalServiceContainer + PostSharp.Samples.DependencyResolution.GlobalServiceContainer + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/Program.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/Program.cs new file mode 100644 index 0000000..0cf6bb1 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/Program.cs @@ -0,0 +1,138 @@ +using System; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition.Primitives; +using System.Reflection; +using PostSharp.Aspects; +using PostSharp.Extensibility; +using PostSharp.Serialization; +using System.IO; + + +/// +/// Using a Global Composition Container +/// see code samples at +/// +namespace PostSharp.Samples.DependencyResolution.GlobalServiceContainer +{ + public interface ILogger + { + void Log(string message); + } + + public static class AspectServiceInjector + { + /// + /// A class instance of a Managed Extensibility Framework Container. + /// The Managed Extensibility Framework or MEF is a library for creating + /// lightweight, and extensible applications. It allows application + /// developers to discover and use extensions with no configuration required. + /// See the following link for more about MEF, + /// . + /// + private static CompositionContainer container; // + + public static void Initialize(ComposablePartCatalog catalog) + { + container = new CompositionContainer(catalog); + } + + public static void BuildObject(object o) + { + if (container == null) + throw new InvalidOperationException(); + + container.SatisfyImportsOnce(o); + } + } + + [PSerializable] + public class LogAspect : OnMethodBoundaryAspect + { + [Import] private ILogger logger; + + + public override void RuntimeInitialize(MethodBase method) + { + AspectServiceInjector.BuildObject(this); + } + + public override void OnEntry(MethodExecutionArgs args) + { + logger.Log("OnEntry"); + } + + public override void OnExit(MethodExecutionArgs args) + { + logger.Log("OnExit"); + } + + public override void OnSuccess(MethodExecutionArgs args) + { + logger.Log("OnSuccess"); + } + } + + internal class Program + { + private static void Main(string[] args) + { + bool SHOWCONSOLE = false; + + if (SHOWCONSOLE) + { + //Un-comment For Console Logging + AspectServiceInjector.Initialize(new TypeCatalog(typeof(ConsoleLogger))); + } + else + { + //Un-comment For File Logging + AspectServiceInjector.Initialize(new TypeCatalog(typeof(FileLogger))); + } + + // The static constructor of LogAspect is called before the static constructor of the type + // containing target methods. This is why we cannot use the aspect in the Program class. + Foo.LoggedMethod(); + + //Pauses the app for viewing. + Console.ReadLine(); + } + } + + internal class Foo + { + [LogAspect] + public static void LoggedMethod() + { + Console.WriteLine("Hello, world." + Environment.NewLine); + } + } + + [Export(typeof(ILogger))] + internal class ConsoleLogger : ILogger + { + public void Log(string message) + { + Console.WriteLine(message); + } + } + + [Export(typeof(ILogger))] + internal class FileLogger : ILogger + { + public void Log(string message) + { + try + { + var path = Path.Combine(Directory.GetCurrentDirectory(), "FileLoggerOutput.txt"); + File.AppendAllText(path, message + Environment.NewLine); + Console.WriteLine($"Wrote: {message} to {path}.\n"); + } + catch (Exception ex) + { + Console.WriteLine($"{ex.Message}\n {ex.StackTrace}"); + } + } + } +} + diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e395777 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.GlobalServiceContainer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.GlobalServiceContainer")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e2051672-b2c6-45a1-b2be-411f483c667f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/packages.config new file mode 100644 index 0000000..e9ff227 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test.csproj new file mode 100644 index 0000000..e002c7c --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test.csproj @@ -0,0 +1,82 @@ + + + + + + + Debug + AnyCPU + {59D1CC9F-F679-420E-9314-F72D931DB1B0} + Library + Properties + PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test + PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + {877d8fe2-c40e-4938-a866-d3437717bba9} + PostSharp.Samples.DependencyResolution.GlobalServiceLocator + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..60b2571 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("59d1cc9f-f679-420e-9314-f72d931db1b0")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/TestLogAspect.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/TestLogAspect.cs new file mode 100644 index 0000000..f75782c --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/TestLogAspect.cs @@ -0,0 +1,52 @@ +using System; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using PostSharp.Samples.DependencyResolution.GlobalServiceLocator; + +namespace DependencyResolution.GlobalServiceLocator.Test +{ + [TestClass] + public class TestLogAspect + { + static TestLogAspect() + { + AspectServiceLocator.Initialize(new TypeCatalog(typeof(TestLogger))); + } + + [TestMethod] + public void TestMethod() + { + TestLogger.Clear(); + TargetMethod(); + Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog()); + } + + [LogAspect] + private void TargetMethod() + { + } + } + + [Export(typeof(ILogger))] + internal class TestLogger : ILogger + { + public static readonly StringBuilder stringBuilder = new StringBuilder(); + + public void Log(string message) + { + stringBuilder.AppendLine(message); + } + + public static string GetLog() + { + return stringBuilder.ToString(); + } + + public static void Clear() + { + stringBuilder.Clear(); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/packages.config new file mode 100644 index 0000000..6dec090 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/App.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.csproj new file mode 100644 index 0000000..31e2d08 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/PostSharp.Samples.DependencyResolution.GlobalServiceLocator.csproj @@ -0,0 +1,69 @@ + + + + + + Debug + AnyCPU + {877D8FE2-C40E-4938-A866-D3437717BBA9} + Exe + PostSharp.Samples.DependencyResolution.GlobalServiceLocator + PostSharp.Samples.DependencyResolution.GlobalServiceLocator + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/Program.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/Program.cs new file mode 100644 index 0000000..81610ba --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/Program.cs @@ -0,0 +1,86 @@ +using System; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition.Primitives; +using PostSharp.Aspects; +using PostSharp.Extensibility; +using PostSharp.Serialization; + +namespace PostSharp.Samples.DependencyResolution.GlobalServiceLocator +{ + public interface ILogger + { + void Log(string message); + } + + public static class AspectServiceLocator + { + private static CompositionContainer container; + + public static void Initialize(ComposablePartCatalog catalog) + { + container = new CompositionContainer(catalog); + } + + public static Lazy GetService() where T : class + { + return new Lazy(GetServiceImpl); + } + + private static T GetServiceImpl() + { + if (container == null) + throw new InvalidOperationException(); + + return container.GetExport().Value; + } + } + + [PSerializable] + public class LogAspect : OnMethodBoundaryAspect + { + private static readonly Lazy logger; + + static LogAspect() + { + if (!PostSharpEnvironment.IsPostSharpRunning) + { + logger = AspectServiceLocator.GetService(); + } + } + + + public override void OnEntry(MethodExecutionArgs args) + { + logger.Value.Log("OnEntry"); + } + } + + internal class Program + { + private static void Main(string[] args) + { + AspectServiceLocator.Initialize(new TypeCatalog(typeof(ConsoleLogger))); + + LoggedMethod(); + + Console.ReadLine(); + } + + [LogAspect] + public static void LoggedMethod() + { + Console.WriteLine("Hello, world."); + } + } + + + [Export(typeof(ILogger))] + internal class ConsoleLogger : ILogger + { + public void Log(string message) + { + Console.WriteLine(message); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c5f01a0 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.GlobalServiceLocator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.GlobalServiceLocator")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("877d8fe2-c40e-4938-a866-d3437717bba9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/packages.config new file mode 100644 index 0000000..e9ff227 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/PostSharp.Samples.DependencyResolution.InstanceScoped.Test.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/PostSharp.Samples.DependencyResolution.InstanceScoped.Test.csproj new file mode 100644 index 0000000..c140073 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/PostSharp.Samples.DependencyResolution.InstanceScoped.Test.csproj @@ -0,0 +1,82 @@ + + + + + + + Debug + AnyCPU + {5033CF4F-A8DF-43D8-A70B-6206466B4543} + Library + Properties + PostSharp.Samples.DependencyResolution.InstanceScoped.Test + PostSharp.Samples.DependencyResolution.InstanceScoped.Test + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + {c44249bc-9b06-4a42-aedd-3fe2b472ebba} + PostSharp.Samples.DependencyResolution.InstanceScoped + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ec3c487 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.InstanceScoped.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.InstanceScoped.Test")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("5033cf4f-a8df-43d8-a70b-6206466b4543")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/TestLogAspect.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/TestLogAspect.cs new file mode 100644 index 0000000..6cdb52b --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/TestLogAspect.cs @@ -0,0 +1,53 @@ +using System; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace PostSharp.Samples.DependencyResolution.InstanceScoped.Test +{ + [TestClass] + public class TestLogAspect + { + [TestMethod] + public void TestMethod() + { + TypeCatalog catalog = new TypeCatalog(typeof(TestLogger), typeof(TestImpl)); + CompositionContainer container = new CompositionContainer(catalog); + TestImpl service = container.GetExport().Value; + TestLogger.Clear(); + service.TargetMethod(); + Assert.AreEqual("OnEntry" + Environment.NewLine, TestLogger.GetLog()); + } + + [Export(typeof(TestImpl))] + private class TestImpl + { + [LogAspect] + public void TargetMethod() + { + } + } + } + + [Export(typeof(ILogger))] + internal class TestLogger : ILogger + { + public static readonly StringBuilder stringBuilder = new StringBuilder(); + + public void Log(string message) + { + stringBuilder.AppendLine(message); + } + + public static string GetLog() + { + return stringBuilder.ToString(); + } + + public static void Clear() + { + stringBuilder.Clear(); + } + } +} diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/packages.config new file mode 100644 index 0000000..6dec090 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped.Test/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/App.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/PostSharp.Samples.DependencyResolution.InstanceScoped.csproj b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/PostSharp.Samples.DependencyResolution.InstanceScoped.csproj new file mode 100644 index 0000000..ce4421d --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/PostSharp.Samples.DependencyResolution.InstanceScoped.csproj @@ -0,0 +1,69 @@ + + + + + + Debug + AnyCPU + {C44249BC-9B06-4A42-AEDD-3FE2B472EBBA} + Exe + PostSharp.Samples.DependencyResolution.InstanceScoped + PostSharp.Samples.DependencyResolution.InstanceScoped + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\PostSharp.Redist.5.0.37\lib\net45\PostSharp.dll + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/Program.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/Program.cs new file mode 100644 index 0000000..70b7471 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/Program.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition.Primitives; +using System.ComponentModel.Design; +using System.Reflection; +using PostSharp.Aspects; +using PostSharp.Aspects.Advices; +using PostSharp.Extensibility; +using PostSharp.Reflection; +using PostSharp.Serialization; + +namespace PostSharp.Samples.DependencyResolution.InstanceScoped +{ + public interface ILogger + { + void Log(string message); + } + + + [PSerializable] + public class LogAspect : OnMethodBoundaryAspect, IInstanceScopedAspect + { + [IntroduceMember(Visibility = Visibility.Family, OverrideAction = MemberOverrideAction.Ignore)] + [CopyCustomAttributes(typeof(ImportAttribute))] + [Import(typeof(ILogger))] + public ILogger Logger { get; set; } + + [ImportMember("Logger", IsRequired = true)] + public Property LoggerProperty; + + public override void OnEntry(MethodExecutionArgs args) + { + this.LoggerProperty.Get().Log("OnEntry"); + } + + object IInstanceScopedAspect.CreateInstance(AdviceArgs adviceArgs) + { + return this.MemberwiseClone(); + } + + void IInstanceScopedAspect.RuntimeInitializeInstance() + { + } + } + + + [Export(typeof(MyServiceImpl))] + internal class MyServiceImpl + { + [LogAspect] + public void LoggedMethod() + { + Console.WriteLine("Hello, world."); + } + } + + internal class Program + { + private static void Main(string[] args) + { + AssemblyCatalog catalog = new AssemblyCatalog(typeof(Program).Assembly); + CompositionContainer container = new CompositionContainer(catalog); + MyServiceImpl service = container.GetExport().Value; + service.LoggedMethod(); + + Console.ReadLine(); + } + } + + + [Export(typeof(ILogger))] + internal class ConsoleLogger : ILogger + { + public void Log(string message) + { + Console.WriteLine(message); + } + } +} \ No newline at end of file diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/Properties/AssemblyInfo.cs b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ec92d85 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PostSharp.Samples.DependencyResolution.InstanceScoped")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PostSharp.Samples.DependencyResolution.InstanceScoped")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c44249bc-9b06-4a42-aedd-3fe2b472ebba")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/packages.config b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/packages.config new file mode 100644 index 0000000..e9ff227 --- /dev/null +++ b/DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/PostSharp.Samples.sln b/PostSharp.Samples.sln index 874952b..c6a03a9 100644 --- a/PostSharp.Samples.sln +++ b/PostSharp.Samples.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.452 +VisualStudioVersion = 16.0.29613.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.CustomLogging", "Framework\PostSharp.Samples.CustomLogging\PostSharp.Samples.CustomLogging.csproj", "{C943DF92-512E-4488-83C0-96DD10CA9854}" EndProject @@ -21,8 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.Xaml", "X EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A414FFE7-2FE3-4AC9-B12A-9E6EF736553E}" ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .filenesting.json = .filenesting.json PostSharp.Samples.pssln = PostSharp.Samples.pssln README.md = README.md EndProjectSection @@ -55,6 +53,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solid", "Solid", "{6B37892E EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.Caching", "Solid\PostSharp.Samples.Caching\PostSharp.Samples.Caching.csproj", "{547C4D64-3349-4909-B261-A2242E21E228}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.Frigate.Generator", "Diagnostics\PostSharp.Samples.Frigate.Generator\PostSharp.Samples.Frigate.Generator.csproj", "{963578D1-7916-49E9-BE59-BA52721A6FF3}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.ResharperAnnotations", "Framework\PostSharp.Samples.ResharperAnnotations\PostSharp.Samples.ResharperAnnotations.csproj", "{4CC21052-7D9D-41DE-B8BB-0263F63C0133}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Architecture Framework", "Architecture Framework", "{941432CE-B1EA-4050-B86A-A0689F0F18A7}" @@ -85,23 +85,33 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.Logging.L EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.Logging.CommonLogging", "Diagnostics\PostSharp.Samples.Logging.CommonLogging\PostSharp.Samples.Logging.CommonLogging.csproj", "{CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.Logging.Etw.CustomSource", "Diagnostics\PostSharp.Samples.Logging.Etw.CustomSource\PostSharp.Samples.Logging.Etw.CustomSource.csproj", "{637CB8F6-4F80-4D14-B1A6-2095A2A743C9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyResolution", "DependencyResolution", "{09D4E470-EFBF-4C60-90B6-2C0B7F5F4860}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.NormalizeString", "Framework\PostSharp.Samples.NormalizeString\PostSharp.Samples.NormalizeString.csproj", "{EB412369-CE3D-4D0F-9E16-A93D501DAA1A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.GlobalServiceContainer", "DependencyResolution\PostSharp.Samples.DependencyResolution.GlobalServiceContainer\PostSharp.Samples.DependencyResolution.GlobalServiceContainer.csproj", "{E2051672-B2C6-45A1-B2BE-411F483C667F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ElasticStack", "ElasticStack", "{6B66C0C7-17E9-4888-826E-0168EBDFC2A7}" - ProjectSection(SolutionItems) = preProject - Diagnostics\PostSharp.Samples.Logging.ElasticStack\README.md = Diagnostics\PostSharp.Samples.Logging.ElasticStack\README.md - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test", "DependencyResolution\PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test\PostSharp.Samples.DependencyResolution.GlobalServiceContainer.Test.csproj", "{7600D5FB-8111-4170-A1DC-F9E060179D50}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4C12393E-9C3A-426E-8D14-ED743B208C9A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test", "DependencyResolution\PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test\PostSharp.Samples.DependencyResolution.GlobalServiceLocator.Test.csproj", "{59D1CC9F-F679-420E-9314-F72D931DB1B0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.GlobalServiceLocator", "DependencyResolution\PostSharp.Samples.DependencyResolution.GlobalServiceLocator\PostSharp.Samples.DependencyResolution.GlobalServiceLocator.csproj", "{877D8FE2-C40E-4938-A866-D3437717BBA9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.Dynamic", "DependencyResolution\PostSharp.Samples.DependencyResolution.Dynamic\PostSharp.Samples.DependencyResolution.Dynamic.csproj", "{DE06EE91-AA77-43A4-B3CB-F21EDAFAC25F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.Dynamic.Test", "DependencyResolution\PostSharp.Samples.DependencyResolution.Dynamic.Test\PostSharp.Samples.DependencyResolution.Dynamic.Test.csproj", "{C7F763E3-29BD-44F6-B8F6-1EEDC3D19932}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.Contextual", "DependencyResolution\PostSharp.Samples.DependencyResolution.Contextual\PostSharp.Samples.DependencyResolution.Contextual.csproj", "{9DFD9BDB-FB8B-4066-A62E-670C20CE1213}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.Contextual.Test", "DependencyResolution\PostSharp.Samples.DependencyResolution.Contextual.Test\PostSharp.Samples.DependencyResolution.Contextual.Test.csproj", "{232F6D41-893E-4526-9C4A-94C57EF12B6F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClientExample", "Diagnostics\PostSharp.Samples.Logging.ElasticStack\ClientExample\ClientExample.csproj", "{D13928C0-62FE-4B93-86BC-E45B147C7C08}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.InstanceScoped", "DependencyResolution\PostSharp.Samples.DependencyResolution.InstanceScoped\PostSharp.Samples.DependencyResolution.InstanceScoped.csproj", "{C44249BC-9B06-4A42-AEDD-3FE2B472EBBA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MicroserviceExample", "Diagnostics\PostSharp.Samples.Logging.ElasticStack\MicroserviceExample\MicroserviceExample.csproj", "{B4216E1F-7FBC-4D5F-AE1A-38E67EC88852}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PostSharp.Samples.DependencyResolution.InstanceScoped.Test", "DependencyResolution\PostSharp.Samples.DependencyResolution.InstanceScoped.Test\PostSharp.Samples.DependencyResolution.InstanceScoped.Test.csproj", "{5033CF4F-A8DF-43D8-A70B-6206466B4543}" EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution Diagnostics\PostSharp.Samples.Logging.BusinessLogic\PostSharp.Samples.Logging.BusinessLogic.projitems*{49e1beb2-613f-4326-a3aa-2984ab1a0931}*SharedItemsImports = 4 - Diagnostics\PostSharp.Samples.Logging.BusinessLogic\PostSharp.Samples.Logging.BusinessLogic.projitems*{637cb8f6-4f80-4d14-b1a6-2095a2a743c9}*SharedItemsImports = 4 Diagnostics\PostSharp.Samples.Logging.BusinessLogic\PostSharp.Samples.Logging.BusinessLogic.projitems*{640c57c0-5220-416f-9152-3d5a98b0d71a}*SharedItemsImports = 4 Diagnostics\PostSharp.Samples.Logging.BusinessLogic\PostSharp.Samples.Logging.BusinessLogic.projitems*{80d82101-021a-4611-8dac-5deaedc00d8f}*SharedItemsImports = 4 Diagnostics\PostSharp.Samples.Logging.BusinessLogic\PostSharp.Samples.Logging.BusinessLogic.projitems*{8cc6b1da-28c5-4b03-b048-6e03c56b8bcc}*SharedItemsImports = 13 @@ -114,214 +124,173 @@ Global EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Development|Any CPU = Development|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C943DF92-512E-4488-83C0-96DD10CA9854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C943DF92-512E-4488-83C0-96DD10CA9854}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C943DF92-512E-4488-83C0-96DD10CA9854}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {C943DF92-512E-4488-83C0-96DD10CA9854}.Development|Any CPU.Build.0 = Debug|Any CPU {C943DF92-512E-4488-83C0-96DD10CA9854}.Release|Any CPU.ActiveCfg = Release|Any CPU {C943DF92-512E-4488-83C0-96DD10CA9854}.Release|Any CPU.Build.0 = Release|Any CPU {20AC1E41-945E-4F53-9C00-99AFE4A01EDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {20AC1E41-945E-4F53-9C00-99AFE4A01EDF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20AC1E41-945E-4F53-9C00-99AFE4A01EDF}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {20AC1E41-945E-4F53-9C00-99AFE4A01EDF}.Development|Any CPU.Build.0 = Debug|Any CPU {20AC1E41-945E-4F53-9C00-99AFE4A01EDF}.Release|Any CPU.ActiveCfg = Release|Any CPU {20AC1E41-945E-4F53-9C00-99AFE4A01EDF}.Release|Any CPU.Build.0 = Release|Any CPU {011B1320-BB21-4CC8-81C9-64A9CA31DD69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {011B1320-BB21-4CC8-81C9-64A9CA31DD69}.Debug|Any CPU.Build.0 = Debug|Any CPU - {011B1320-BB21-4CC8-81C9-64A9CA31DD69}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {011B1320-BB21-4CC8-81C9-64A9CA31DD69}.Development|Any CPU.Build.0 = Debug|Any CPU {011B1320-BB21-4CC8-81C9-64A9CA31DD69}.Release|Any CPU.ActiveCfg = Release|Any CPU {011B1320-BB21-4CC8-81C9-64A9CA31DD69}.Release|Any CPU.Build.0 = Release|Any CPU {2413A15B-6B4C-48BB-AF5E-3AAF0C1FDE7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2413A15B-6B4C-48BB-AF5E-3AAF0C1FDE7F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2413A15B-6B4C-48BB-AF5E-3AAF0C1FDE7F}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {2413A15B-6B4C-48BB-AF5E-3AAF0C1FDE7F}.Development|Any CPU.Build.0 = Debug|Any CPU {2413A15B-6B4C-48BB-AF5E-3AAF0C1FDE7F}.Release|Any CPU.ActiveCfg = Release|Any CPU {2413A15B-6B4C-48BB-AF5E-3AAF0C1FDE7F}.Release|Any CPU.Build.0 = Release|Any CPU {4868DED2-44EA-47BB-BAD9-DB35E97FF3BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4868DED2-44EA-47BB-BAD9-DB35E97FF3BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4868DED2-44EA-47BB-BAD9-DB35E97FF3BB}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {4868DED2-44EA-47BB-BAD9-DB35E97FF3BB}.Development|Any CPU.Build.0 = Debug|Any CPU {4868DED2-44EA-47BB-BAD9-DB35E97FF3BB}.Release|Any CPU.ActiveCfg = Release|Any CPU {4868DED2-44EA-47BB-BAD9-DB35E97FF3BB}.Release|Any CPU.Build.0 = Release|Any CPU {6ACA8A5D-2E0D-438B-898F-E73594D6D8F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6ACA8A5D-2E0D-438B-898F-E73594D6D8F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6ACA8A5D-2E0D-438B-898F-E73594D6D8F8}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {6ACA8A5D-2E0D-438B-898F-E73594D6D8F8}.Development|Any CPU.Build.0 = Debug|Any CPU {6ACA8A5D-2E0D-438B-898F-E73594D6D8F8}.Release|Any CPU.ActiveCfg = Release|Any CPU {6ACA8A5D-2E0D-438B-898F-E73594D6D8F8}.Release|Any CPU.Build.0 = Release|Any CPU {B483DC19-BD2F-4276-9F08-A77DB8589C1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B483DC19-BD2F-4276-9F08-A77DB8589C1C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B483DC19-BD2F-4276-9F08-A77DB8589C1C}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {B483DC19-BD2F-4276-9F08-A77DB8589C1C}.Development|Any CPU.Build.0 = Debug|Any CPU {B483DC19-BD2F-4276-9F08-A77DB8589C1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {B483DC19-BD2F-4276-9F08-A77DB8589C1C}.Release|Any CPU.Build.0 = Release|Any CPU {B10B8456-75F7-4D68-9775-CC87517B07B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B10B8456-75F7-4D68-9775-CC87517B07B6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B10B8456-75F7-4D68-9775-CC87517B07B6}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {B10B8456-75F7-4D68-9775-CC87517B07B6}.Development|Any CPU.Build.0 = Debug|Any CPU {B10B8456-75F7-4D68-9775-CC87517B07B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {B10B8456-75F7-4D68-9775-CC87517B07B6}.Release|Any CPU.Build.0 = Release|Any CPU {4C86E0AF-0033-4583-90F1-9A37B29783F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4C86E0AF-0033-4583-90F1-9A37B29783F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C86E0AF-0033-4583-90F1-9A37B29783F8}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {4C86E0AF-0033-4583-90F1-9A37B29783F8}.Development|Any CPU.Build.0 = Debug|Any CPU {4C86E0AF-0033-4583-90F1-9A37B29783F8}.Release|Any CPU.ActiveCfg = Release|Any CPU {4C86E0AF-0033-4583-90F1-9A37B29783F8}.Release|Any CPU.Build.0 = Release|Any CPU {33D8E82D-5474-4AC1-878A-0D9B0C28F73B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {33D8E82D-5474-4AC1-878A-0D9B0C28F73B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {33D8E82D-5474-4AC1-878A-0D9B0C28F73B}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {33D8E82D-5474-4AC1-878A-0D9B0C28F73B}.Development|Any CPU.Build.0 = Debug|Any CPU {33D8E82D-5474-4AC1-878A-0D9B0C28F73B}.Release|Any CPU.ActiveCfg = Release|Any CPU {33D8E82D-5474-4AC1-878A-0D9B0C28F73B}.Release|Any CPU.Build.0 = Release|Any CPU {2ABD1A34-FC7D-4B6A-94D3-2266D72F09E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2ABD1A34-FC7D-4B6A-94D3-2266D72F09E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2ABD1A34-FC7D-4B6A-94D3-2266D72F09E0}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {2ABD1A34-FC7D-4B6A-94D3-2266D72F09E0}.Development|Any CPU.Build.0 = Debug|Any CPU {2ABD1A34-FC7D-4B6A-94D3-2266D72F09E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {2ABD1A34-FC7D-4B6A-94D3-2266D72F09E0}.Release|Any CPU.Build.0 = Release|Any CPU {F07449FA-C066-4FD3-AA80-C0A3DC8B268B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F07449FA-C066-4FD3-AA80-C0A3DC8B268B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F07449FA-C066-4FD3-AA80-C0A3DC8B268B}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {F07449FA-C066-4FD3-AA80-C0A3DC8B268B}.Development|Any CPU.Build.0 = Debug|Any CPU {F07449FA-C066-4FD3-AA80-C0A3DC8B268B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F07449FA-C066-4FD3-AA80-C0A3DC8B268B}.Release|Any CPU.Build.0 = Release|Any CPU {A4E6B3B1-D79E-4FFB-A8EB-5066C2D57047}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A4E6B3B1-D79E-4FFB-A8EB-5066C2D57047}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4E6B3B1-D79E-4FFB-A8EB-5066C2D57047}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {A4E6B3B1-D79E-4FFB-A8EB-5066C2D57047}.Development|Any CPU.Build.0 = Debug|Any CPU {A4E6B3B1-D79E-4FFB-A8EB-5066C2D57047}.Release|Any CPU.ActiveCfg = Release|Any CPU {A4E6B3B1-D79E-4FFB-A8EB-5066C2D57047}.Release|Any CPU.Build.0 = Release|Any CPU {C24F62F1-BCFB-41F5-9119-2E36C2D7413F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C24F62F1-BCFB-41F5-9119-2E36C2D7413F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C24F62F1-BCFB-41F5-9119-2E36C2D7413F}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {C24F62F1-BCFB-41F5-9119-2E36C2D7413F}.Development|Any CPU.Build.0 = Debug|Any CPU {C24F62F1-BCFB-41F5-9119-2E36C2D7413F}.Release|Any CPU.ActiveCfg = Release|Any CPU {C24F62F1-BCFB-41F5-9119-2E36C2D7413F}.Release|Any CPU.Build.0 = Release|Any CPU {7B76A67B-2667-4E79-8D33-6AAF769BB4FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B76A67B-2667-4E79-8D33-6AAF769BB4FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B76A67B-2667-4E79-8D33-6AAF769BB4FE}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {7B76A67B-2667-4E79-8D33-6AAF769BB4FE}.Development|Any CPU.Build.0 = Debug|Any CPU {7B76A67B-2667-4E79-8D33-6AAF769BB4FE}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B76A67B-2667-4E79-8D33-6AAF769BB4FE}.Release|Any CPU.Build.0 = Release|Any CPU {EEF6E032-8DF0-4894-A593-F9EC9CC539A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EEF6E032-8DF0-4894-A593-F9EC9CC539A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEF6E032-8DF0-4894-A593-F9EC9CC539A7}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {EEF6E032-8DF0-4894-A593-F9EC9CC539A7}.Development|Any CPU.Build.0 = Debug|Any CPU {EEF6E032-8DF0-4894-A593-F9EC9CC539A7}.Release|Any CPU.ActiveCfg = Release|Any CPU {EEF6E032-8DF0-4894-A593-F9EC9CC539A7}.Release|Any CPU.Build.0 = Release|Any CPU {547C4D64-3349-4909-B261-A2242E21E228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {547C4D64-3349-4909-B261-A2242E21E228}.Debug|Any CPU.Build.0 = Debug|Any CPU - {547C4D64-3349-4909-B261-A2242E21E228}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {547C4D64-3349-4909-B261-A2242E21E228}.Development|Any CPU.Build.0 = Debug|Any CPU {547C4D64-3349-4909-B261-A2242E21E228}.Release|Any CPU.ActiveCfg = Release|Any CPU {547C4D64-3349-4909-B261-A2242E21E228}.Release|Any CPU.Build.0 = Release|Any CPU + {963578D1-7916-49E9-BE59-BA52721A6FF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {963578D1-7916-49E9-BE59-BA52721A6FF3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {963578D1-7916-49E9-BE59-BA52721A6FF3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {963578D1-7916-49E9-BE59-BA52721A6FF3}.Release|Any CPU.Build.0 = Release|Any CPU {4CC21052-7D9D-41DE-B8BB-0263F63C0133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4CC21052-7D9D-41DE-B8BB-0263F63C0133}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CC21052-7D9D-41DE-B8BB-0263F63C0133}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {4CC21052-7D9D-41DE-B8BB-0263F63C0133}.Development|Any CPU.Build.0 = Debug|Any CPU {4CC21052-7D9D-41DE-B8BB-0263F63C0133}.Release|Any CPU.ActiveCfg = Release|Any CPU {4CC21052-7D9D-41DE-B8BB-0263F63C0133}.Release|Any CPU.Build.0 = Release|Any CPU {80D82101-021A-4611-8DAC-5DEAEDC00D8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {80D82101-021A-4611-8DAC-5DEAEDC00D8F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80D82101-021A-4611-8DAC-5DEAEDC00D8F}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {80D82101-021A-4611-8DAC-5DEAEDC00D8F}.Development|Any CPU.Build.0 = Debug|Any CPU {80D82101-021A-4611-8DAC-5DEAEDC00D8F}.Release|Any CPU.ActiveCfg = Release|Any CPU {80D82101-021A-4611-8DAC-5DEAEDC00D8F}.Release|Any CPU.Build.0 = Release|Any CPU {A640CF21-CE2F-4FDE-BD6A-F148A421E0FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A640CF21-CE2F-4FDE-BD6A-F148A421E0FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A640CF21-CE2F-4FDE-BD6A-F148A421E0FF}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {A640CF21-CE2F-4FDE-BD6A-F148A421E0FF}.Development|Any CPU.Build.0 = Debug|Any CPU {A640CF21-CE2F-4FDE-BD6A-F148A421E0FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {A640CF21-CE2F-4FDE-BD6A-F148A421E0FF}.Release|Any CPU.Build.0 = Release|Any CPU {49E1BEB2-613F-4326-A3AA-2984AB1A0931}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {49E1BEB2-613F-4326-A3AA-2984AB1A0931}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49E1BEB2-613F-4326-A3AA-2984AB1A0931}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {49E1BEB2-613F-4326-A3AA-2984AB1A0931}.Development|Any CPU.Build.0 = Debug|Any CPU {49E1BEB2-613F-4326-A3AA-2984AB1A0931}.Release|Any CPU.ActiveCfg = Release|Any CPU {49E1BEB2-613F-4326-A3AA-2984AB1A0931}.Release|Any CPU.Build.0 = Release|Any CPU {97830C73-1D7F-48A4-92F0-0BEABC8216DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {97830C73-1D7F-48A4-92F0-0BEABC8216DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97830C73-1D7F-48A4-92F0-0BEABC8216DB}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {97830C73-1D7F-48A4-92F0-0BEABC8216DB}.Development|Any CPU.Build.0 = Debug|Any CPU {97830C73-1D7F-48A4-92F0-0BEABC8216DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {97830C73-1D7F-48A4-92F0-0BEABC8216DB}.Release|Any CPU.Build.0 = Release|Any CPU {640C57C0-5220-416F-9152-3D5A98B0D71A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {640C57C0-5220-416F-9152-3D5A98B0D71A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {640C57C0-5220-416F-9152-3D5A98B0D71A}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {640C57C0-5220-416F-9152-3D5A98B0D71A}.Development|Any CPU.Build.0 = Debug|Any CPU {640C57C0-5220-416F-9152-3D5A98B0D71A}.Release|Any CPU.ActiveCfg = Release|Any CPU {640C57C0-5220-416F-9152-3D5A98B0D71A}.Release|Any CPU.Build.0 = Release|Any CPU {FB71F9B1-4A53-4397-A26C-23294423DA4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FB71F9B1-4A53-4397-A26C-23294423DA4D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FB71F9B1-4A53-4397-A26C-23294423DA4D}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {FB71F9B1-4A53-4397-A26C-23294423DA4D}.Development|Any CPU.Build.0 = Debug|Any CPU {FB71F9B1-4A53-4397-A26C-23294423DA4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {FB71F9B1-4A53-4397-A26C-23294423DA4D}.Release|Any CPU.Build.0 = Release|Any CPU {6C94BDFF-B0F8-42DE-898B-93375A165ACC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6C94BDFF-B0F8-42DE-898B-93375A165ACC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C94BDFF-B0F8-42DE-898B-93375A165ACC}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {6C94BDFF-B0F8-42DE-898B-93375A165ACC}.Development|Any CPU.Build.0 = Debug|Any CPU {6C94BDFF-B0F8-42DE-898B-93375A165ACC}.Release|Any CPU.ActiveCfg = Release|Any CPU {6C94BDFF-B0F8-42DE-898B-93375A165ACC}.Release|Any CPU.Build.0 = Release|Any CPU {CC3F424B-E1BE-4555-A77E-52FA4B14BDA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CC3F424B-E1BE-4555-A77E-52FA4B14BDA0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC3F424B-E1BE-4555-A77E-52FA4B14BDA0}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {CC3F424B-E1BE-4555-A77E-52FA4B14BDA0}.Development|Any CPU.Build.0 = Debug|Any CPU {CC3F424B-E1BE-4555-A77E-52FA4B14BDA0}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC3F424B-E1BE-4555-A77E-52FA4B14BDA0}.Release|Any CPU.Build.0 = Release|Any CPU {55027D93-3DA2-4659-A334-CCCCB98E8AEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {55027D93-3DA2-4659-A334-CCCCB98E8AEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55027D93-3DA2-4659-A334-CCCCB98E8AEB}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {55027D93-3DA2-4659-A334-CCCCB98E8AEB}.Development|Any CPU.Build.0 = Debug|Any CPU {55027D93-3DA2-4659-A334-CCCCB98E8AEB}.Release|Any CPU.ActiveCfg = Release|Any CPU {55027D93-3DA2-4659-A334-CCCCB98E8AEB}.Release|Any CPU.Build.0 = Release|Any CPU {4AA8652E-00D6-46F0-A176-2CA5BFFDDA58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4AA8652E-00D6-46F0-A176-2CA5BFFDDA58}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4AA8652E-00D6-46F0-A176-2CA5BFFDDA58}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {4AA8652E-00D6-46F0-A176-2CA5BFFDDA58}.Development|Any CPU.Build.0 = Debug|Any CPU {4AA8652E-00D6-46F0-A176-2CA5BFFDDA58}.Release|Any CPU.ActiveCfg = Release|Any CPU {4AA8652E-00D6-46F0-A176-2CA5BFFDDA58}.Release|Any CPU.Build.0 = Release|Any CPU {90A7F2AD-E82B-4285-9D3D-070E95D2F0BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {90A7F2AD-E82B-4285-9D3D-070E95D2F0BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90A7F2AD-E82B-4285-9D3D-070E95D2F0BA}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {90A7F2AD-E82B-4285-9D3D-070E95D2F0BA}.Development|Any CPU.Build.0 = Debug|Any CPU {90A7F2AD-E82B-4285-9D3D-070E95D2F0BA}.Release|Any CPU.ActiveCfg = Release|Any CPU {90A7F2AD-E82B-4285-9D3D-070E95D2F0BA}.Release|Any CPU.Build.0 = Release|Any CPU {CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644}.Development|Any CPU.Build.0 = Debug|Any CPU {CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644}.Release|Any CPU.ActiveCfg = Release|Any CPU {CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644}.Release|Any CPU.Build.0 = Release|Any CPU - {637CB8F6-4F80-4D14-B1A6-2095A2A743C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {637CB8F6-4F80-4D14-B1A6-2095A2A743C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {637CB8F6-4F80-4D14-B1A6-2095A2A743C9}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {637CB8F6-4F80-4D14-B1A6-2095A2A743C9}.Development|Any CPU.Build.0 = Debug|Any CPU - {637CB8F6-4F80-4D14-B1A6-2095A2A743C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {637CB8F6-4F80-4D14-B1A6-2095A2A743C9}.Release|Any CPU.Build.0 = Release|Any CPU - {EB412369-CE3D-4D0F-9E16-A93D501DAA1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EB412369-CE3D-4D0F-9E16-A93D501DAA1A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EB412369-CE3D-4D0F-9E16-A93D501DAA1A}.Development|Any CPU.ActiveCfg = Debug|Any CPU - {EB412369-CE3D-4D0F-9E16-A93D501DAA1A}.Development|Any CPU.Build.0 = Debug|Any CPU - {EB412369-CE3D-4D0F-9E16-A93D501DAA1A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EB412369-CE3D-4D0F-9E16-A93D501DAA1A}.Release|Any CPU.Build.0 = Release|Any CPU - {D13928C0-62FE-4B93-86BC-E45B147C7C08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D13928C0-62FE-4B93-86BC-E45B147C7C08}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D13928C0-62FE-4B93-86BC-E45B147C7C08}.Development|Any CPU.ActiveCfg = Development|Any CPU - {D13928C0-62FE-4B93-86BC-E45B147C7C08}.Development|Any CPU.Build.0 = Development|Any CPU - {D13928C0-62FE-4B93-86BC-E45B147C7C08}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D13928C0-62FE-4B93-86BC-E45B147C7C08}.Release|Any CPU.Build.0 = Release|Any CPU - {B4216E1F-7FBC-4D5F-AE1A-38E67EC88852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4216E1F-7FBC-4D5F-AE1A-38E67EC88852}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4216E1F-7FBC-4D5F-AE1A-38E67EC88852}.Development|Any CPU.ActiveCfg = Development|Any CPU - {B4216E1F-7FBC-4D5F-AE1A-38E67EC88852}.Development|Any CPU.Build.0 = Development|Any CPU - {B4216E1F-7FBC-4D5F-AE1A-38E67EC88852}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4216E1F-7FBC-4D5F-AE1A-38E67EC88852}.Release|Any CPU.Build.0 = Release|Any CPU + {E2051672-B2C6-45A1-B2BE-411F483C667F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2051672-B2C6-45A1-B2BE-411F483C667F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2051672-B2C6-45A1-B2BE-411F483C667F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2051672-B2C6-45A1-B2BE-411F483C667F}.Release|Any CPU.Build.0 = Release|Any CPU + {7600D5FB-8111-4170-A1DC-F9E060179D50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7600D5FB-8111-4170-A1DC-F9E060179D50}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7600D5FB-8111-4170-A1DC-F9E060179D50}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7600D5FB-8111-4170-A1DC-F9E060179D50}.Release|Any CPU.Build.0 = Release|Any CPU + {59D1CC9F-F679-420E-9314-F72D931DB1B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59D1CC9F-F679-420E-9314-F72D931DB1B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59D1CC9F-F679-420E-9314-F72D931DB1B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59D1CC9F-F679-420E-9314-F72D931DB1B0}.Release|Any CPU.Build.0 = Release|Any CPU + {877D8FE2-C40E-4938-A866-D3437717BBA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {877D8FE2-C40E-4938-A866-D3437717BBA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {877D8FE2-C40E-4938-A866-D3437717BBA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {877D8FE2-C40E-4938-A866-D3437717BBA9}.Release|Any CPU.Build.0 = Release|Any CPU + {DE06EE91-AA77-43A4-B3CB-F21EDAFAC25F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE06EE91-AA77-43A4-B3CB-F21EDAFAC25F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE06EE91-AA77-43A4-B3CB-F21EDAFAC25F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE06EE91-AA77-43A4-B3CB-F21EDAFAC25F}.Release|Any CPU.Build.0 = Release|Any CPU + {C7F763E3-29BD-44F6-B8F6-1EEDC3D19932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7F763E3-29BD-44F6-B8F6-1EEDC3D19932}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7F763E3-29BD-44F6-B8F6-1EEDC3D19932}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7F763E3-29BD-44F6-B8F6-1EEDC3D19932}.Release|Any CPU.Build.0 = Release|Any CPU + {9DFD9BDB-FB8B-4066-A62E-670C20CE1213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DFD9BDB-FB8B-4066-A62E-670C20CE1213}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DFD9BDB-FB8B-4066-A62E-670C20CE1213}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DFD9BDB-FB8B-4066-A62E-670C20CE1213}.Release|Any CPU.Build.0 = Release|Any CPU + {232F6D41-893E-4526-9C4A-94C57EF12B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {232F6D41-893E-4526-9C4A-94C57EF12B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {232F6D41-893E-4526-9C4A-94C57EF12B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {232F6D41-893E-4526-9C4A-94C57EF12B6F}.Release|Any CPU.Build.0 = Release|Any CPU + {C44249BC-9B06-4A42-AEDD-3FE2B472EBBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C44249BC-9B06-4A42-AEDD-3FE2B472EBBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C44249BC-9B06-4A42-AEDD-3FE2B472EBBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C44249BC-9B06-4A42-AEDD-3FE2B472EBBA}.Release|Any CPU.Build.0 = Release|Any CPU + {5033CF4F-A8DF-43D8-A70B-6206466B4543}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5033CF4F-A8DF-43D8-A70B-6206466B4543}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5033CF4F-A8DF-43D8-A70B-6206466B4543}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5033CF4F-A8DF-43D8-A70B-6206466B4543}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -344,6 +313,7 @@ Global {7B76A67B-2667-4E79-8D33-6AAF769BB4FE} = {D83514BD-6473-4A66-AD23-D996968DE17C} {EEF6E032-8DF0-4894-A593-F9EC9CC539A7} = {D83514BD-6473-4A66-AD23-D996968DE17C} {547C4D64-3349-4909-B261-A2242E21E228} = {6B37892E-40E4-49C1-8E59-84C2AD14DD73} + {963578D1-7916-49E9-BE59-BA52721A6FF3} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} {4CC21052-7D9D-41DE-B8BB-0263F63C0133} = {D83514BD-6473-4A66-AD23-D996968DE17C} {8CC6B1DA-28C5-4B03-B048-6E03C56B8BCC} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} {80D82101-021A-4611-8DAC-5DEAEDC00D8F} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} @@ -358,11 +328,17 @@ Global {4AA8652E-00D6-46F0-A176-2CA5BFFDDA58} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} {90A7F2AD-E82B-4285-9D3D-070E95D2F0BA} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} {CD5F3675-C0BC-4FE4-8FAE-0CF0A66FD644} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} - {637CB8F6-4F80-4D14-B1A6-2095A2A743C9} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} - {EB412369-CE3D-4D0F-9E16-A93D501DAA1A} = {D83514BD-6473-4A66-AD23-D996968DE17C} - {6B66C0C7-17E9-4888-826E-0168EBDFC2A7} = {B1F3FAC0-64CB-4CFC-994C-DF56801FC743} - {D13928C0-62FE-4B93-86BC-E45B147C7C08} = {6B66C0C7-17E9-4888-826E-0168EBDFC2A7} - {B4216E1F-7FBC-4D5F-AE1A-38E67EC88852} = {6B66C0C7-17E9-4888-826E-0168EBDFC2A7} + {E2051672-B2C6-45A1-B2BE-411F483C667F} = {09D4E470-EFBF-4C60-90B6-2C0B7F5F4860} + {7600D5FB-8111-4170-A1DC-F9E060179D50} = {4C12393E-9C3A-426E-8D14-ED743B208C9A} + {4C12393E-9C3A-426E-8D14-ED743B208C9A} = {09D4E470-EFBF-4C60-90B6-2C0B7F5F4860} + {59D1CC9F-F679-420E-9314-F72D931DB1B0} = {4C12393E-9C3A-426E-8D14-ED743B208C9A} + {877D8FE2-C40E-4938-A866-D3437717BBA9} = {09D4E470-EFBF-4C60-90B6-2C0B7F5F4860} + {DE06EE91-AA77-43A4-B3CB-F21EDAFAC25F} = {09D4E470-EFBF-4C60-90B6-2C0B7F5F4860} + {C7F763E3-29BD-44F6-B8F6-1EEDC3D19932} = {4C12393E-9C3A-426E-8D14-ED743B208C9A} + {9DFD9BDB-FB8B-4066-A62E-670C20CE1213} = {09D4E470-EFBF-4C60-90B6-2C0B7F5F4860} + {232F6D41-893E-4526-9C4A-94C57EF12B6F} = {4C12393E-9C3A-426E-8D14-ED743B208C9A} + {C44249BC-9B06-4A42-AEDD-3FE2B472EBBA} = {09D4E470-EFBF-4C60-90B6-2C0B7F5F4860} + {5033CF4F-A8DF-43D8-A70B-6206466B4543} = {4C12393E-9C3A-426E-8D14-ED743B208C9A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7E95A232-DBEE-4E84-9574-757745FEE89B} diff --git a/README.md b/README.md index 1594e1f..5c660a9 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,9 @@ or you can download them on [GitHub](https://www.github.com/postsharp/PostSharp. | **Threading** | [PostSharp.Samples.Threading.PingPong](Threading/PostSharp.Samples.Threading.PingPong/) | The classic educational ping-pong example. | | [PostSharp.Samples.Threading.ThreadDispatching](Threading/PostSharp.Samples.Threading.ThreadDispatching/) | A simple WPF progress bar updated from a background thread. | - - - - - - \ No newline at end of file +**DependencyResolution** +| [PostSharp.Samples.DependencyResolution.GlobalServiceContainer](DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceContainer/) | Initialize the aspect from an ambient container at run time. | +| [PostSharp.Samples.DependencyResolution.GlobalServiceLocator](DependencyResolution/PostSharp.Samples.DependencyResolution.GlobalServiceLocator/) | Using a global MEF service locator. | +| [PostSharp.Samples.DependencyResolution.Dynamic](DependencyResolution/PostSharp.Samples.DependencyResolution.Dynamic/) | Resolve dependencies dynamically each time they are needed, and not only at aspect initialization. | +| [PostSharp.Samples.DependencyResolution.Contextual](DependencyResolution/PostSharp.Samples.DependencyResolution.Contextual/) | Resolve dependencies to specific implementations for a given context. + [PostSharp.Samples.DependencyResolution.InstanceScoped](DependencyResolution/PostSharp.Samples.DependencyResolution.InstanceScoped/) | Consume dependencies from the objects to which they are applied and also add dependencies to the target objects. |