diff Tools/DocGen/Content/Doc/Aspects/ClearCacheAspect.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools/DocGen/Content/Doc/Aspects/ClearCacheAspect.cs	Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,84 @@
+[BLToolkitGenerated]
+public sealed class TestClass : ClearCacheAspect.TestClass
+{
+	private static MethodInfo _methodInfo1;
+	private static MethodInfo _methodInfo2;
+	private static Type       _type3;
+	private static Type       _type4;
+
+	public override int CachedMethod(int p1, int p2)
+	{
+		// Method implementation.
+	}
+
+	public override void ClearCache()
+	{
+		try
+		{
+			// Here should be main method implementation.
+			// It is empty as this method does nothing.
+		}
+		finally
+		{
+			if (_methodInfo1 == null)
+			{
+				_methodInfo1 = 
+					ClearCacheAspect.GetMethodInfo(this, null, "CachedMethod", null);
+			}
+
+			CacheAspect.ClearCache(_methodInfo1);
+		}
+	}
+
+	public override void ClearCache2()
+	{
+		try
+		{
+		}
+		finally
+		{
+			if (_methodInfo2 == null)
+			{
+				_methodInfo2 = ClearCacheAspect.GetMethodInfo(
+					this,
+					null,
+					"CachedMethod",
+					new Type[] { typeof(int), typeof(int) });
+			}
+
+			CacheAspect.ClearCache(_methodInfo2);
+		}
+	}
+
+	public override void ClearAll()
+	{
+		try
+		{
+		}
+		finally
+		{
+			if (_type3 == null)
+			{
+				_type3 = ClearCacheAspect.GetType(this, typeof(TestClass));
+			}
+
+			CacheAspect.ClearCache(_type3);
+		}
+	}
+
+	public override void ClearAll2()
+	{
+		try
+		{
+		}
+		finally
+		{
+			if (_type4 == null)
+			{
+				_type4 = ClearCacheAspect.GetType(this, null);
+			}
+
+			CacheAspect.ClearCache(_type4);
+		}
+	}
+}