Sunday, 16 January 2011
ByPass GPO USB
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\RemovableStorageDevices
Remove the folders inside this.
Tuesday, 11 January 2011
Unity
Main MSDN Site
Monday, 10 January 2011
Using Interception with Unity
Interception is a design pattern that is designed for cross-cutting concerns, issues that cut across the entire software. Unity provides support for interception through the Interception container extension.
In general, there are two kinds of logic written in most applications; these types of logic are often referred to as business logic and cross-cutting concerns. Business logic is what everyone thinks of when referring to the actual code that performs the functions of the application, such as calculating pay rates and managing inventory. You would expect that this would be the majority of the application, but when you look at many applications you see a lot of the second kind of code that is dedicated to managing infrastructure instead of actually performing the specific function of the application. In some methods, the actual purpose is completely buried under security checks, input validation, logging, and so on. These are known as cross-cutting concerns, because they appear throughout an application in ways that cannot be completely encapsulated in one spot. Because of this, you must repeatedly make the same calls. This repetition makes the code more difficult to maintain.
When you look at many of these cross-cutting concerns, you can recognize a pattern. Many of them happen only at either the start or the end of a method. You log when a method is called. You check your inputs for validity before processing. You handle exceptions after the method fails. This leads to a different approach to implementing cross-cutting concerns. You can put some special handling before or after method calls to handle the cross-cutting concerns, get the code out of the methods, and enhance its maintainability. The Unity Interception extension lets you do just that.
| The Unity Interception extension provides a subset of aspect-oriented programming (AOP). |
The interception mechanism is based around three basic concepts: matching rules, call handlers, and interceptors. Matching rules are simple but flexible objects that determine which methods should have extra handling applied. Call handlers are objects that actually implement the cross-cutting concerns. They can run before or after the method. They can modify method parameters or return values. They can even stop the method from being called at all or call it multiple times. The matching rules and call handlers are grouped together into interception policies. The interception policy uses the matching rules to define which methods get intercepted and uses the call handlers to define what processing to perform on the intercepted object.
For more information, see Configuring and Using Matching Rules,Creating a New Matching Rule, Creating a New Handler, and Configuration Support for Interception.
Policies determine what happens when a method is intercepted, and interceptors determine how methods are intercepted. Unity interceptors will, when configured in the container, enable you to intercept method calls and attach call handlers to the intercepted methods. Policies determine which call handlers are placed in the interception pipeline for each method.
| When using stand alone Unity, you must create your own call handlers. For more information, see Creating a New Handler. You can also use Enterprise Library's Policy Injection Application Block, which includes a number of call handlers. |
All policies supply call handlers to the interceptors when wiring up interception on an object. The policies are either rule driven or attribute driven. The matchingRules are specific to RuleDrivenPolicies. The AttributeDrivenPolicy determines which methods should be intercepted based on methods' attributes. For information about attribute handlers, see Creating a New Handler Attribute.
Using the Unity Interception extension provides the following advantages:
- The infrastructure code can be removed from your method bodies; this makes the code much more readable.
- The interception policy and interceptor settings can be specified in the configuration; this enables you to change behavior without recompiling or even changing the code.
- Facilitated separation of concerns that results in a more flexible, loosely coupled application.
Sunday, 9 January 2011
Microsoft Unity Framework
http://www.microsoft.com/showcase/en/us/details/61cec1b3-23b9-4763-b8fd-939aece7bed4