This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\zproj\CCC\FireWeaverExample\FireWeaverExample\bin\Debug>FireWeaver.Bootstrapper.exe FireWeaverExample.exe FireWeaverExample.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\zproj\CCC\FireWeaverExample\FireWeaverExample\bin\Debug>PEVerify.exe "FireWeaverExample - After.exe" | |
| Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.1 | |
| Copyright (c) Microsoft Corporation. All rights reserved. | |
| [IL]: Error: [C:\zproj\CCC\FireWeaverExample\FireWeaverExample\bin\Debug\FireWeaverExample - After.exe : FireWeaverExample.Program::Main][offset 0x00000006][found ref 'FireWeaverExample.Cat'][expected ref 'FireWeaverExample.Dog'] Unexpected type on the stack. | |
| [IL]: Error: [C:\zproj\CCC\FireWeaverExample\FireWeaverExample\bin\Debug\FireWeaverExample - After.exe : FireWeaverExample.Program::Main][offset 0x00000017][found ref 'FireWeaverExample.Dog'][expected ref 'FireWeaverExample.Cat'] Unexpected type on the stack. | |
| failed to load resource string | |
| FireWeaverExample - After.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.Runtime.CompilerServices; | |
| namespace WeavingExample | |
| { | |
| public class MyService | |
| { | |
| [DebuggerNonUserCode, CompilerGenerated] | |
| internal sealed class <>z__Aspects | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>AOP with jQuery 1</title> | |
| <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="aop.min.js"></script> | |
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| $.aop.before( {target: window, method: 'DisplayUserAgent'}, | |
| function(args) { | |
| alert("About to execute DisplayUserAgent on element with id '" + args[0] + "'"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface IMyService | |
| { | |
| string GetSomeLongRunningResult(string input); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Web.Mvc; | |
| using AopBlog.Models.Repositories; | |
| using AopBlog.Models.Services; | |
| namespace AopBlog.Areas.Manage.Controllers | |
| { | |
| public class AccountController : Controller | |
| { | |
| readonly IAuthorizationService _authService; | |
| readonly IAuthorRepository _authorRepo; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MyAttribute : Attribute | |
| { | |
| public MyAttribute(string something) { } | |
| public MyAttribute(string[] something) { } | |
| } | |
| public class AttributeUsage | |
| { | |
| [MyAttribute("this works")] | |
| public void Method1() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ParsedSqlSelectQuery | |
| { | |
| public IList<string> SelectElements { get; private set; } | |
| public string WhereClause { get; private set; } | |
| public string FromClause { get; private set; } | |
| public ParsedSqlSelectQuery(string sqlQuery) | |
| { | |
| var parser = new TSql100Parser(false); | |
| IList<ParseError> errors; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Web.Mvc; | |
| using PostSharp.Aspects; | |
| namespace MvcApplication1WithPostSharp.Controllers | |
| { | |
| public class HomeController : Controller | |
| { | |
| [MyExitAspect] | |
| public ActionResult Index() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // from: http://weblogs.asp.net/lichen/archive/2012/08/03/gave-a-presentation-on-c-dynamic-and-dynamic-language-runtime-dlr-at-socal-net-user-group-meeting.aspx | |
| // pros: no requirement for members to be virtual, no need for a 3rd party framework | |
| // cons: loss of static typing benefits (i.e. intellisense & compile time checking), not practical for IoC | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| dynamic myObj = new DynamicProxy(new MyClass()); |