Generic Factory Pattern, Open/Closed

The Factory Pattern is a common software development code pattern for creating objects. In this Factory Pattern example we will create a Generic Factory that conforms to the open/closed principle. The open/closed principle states “software classes, modules, functions etc. should be open for extension, but closed for modification. So in this example we will create a Factory that can be extended without having to edit the Factory class.

More



Basic Factory Pattern, using Interfaces

The Factory Pattern is a common software development code pattern for creating objects. In this example we will create a Factory class which is responsible for creating objects that all conform to a common Interface.

More



Using IHttpHandlerFactory

You can use the IHttpHandlerFactory interface to dynamically handle page requests and send them to instances of IHttpHandler.

More



HTTP Status Codes

A key parts of the Hyper Text Transfer Protcol or HTTP are the status codes the Web Server provides in the response. These status codes inform the Web Browser of the status of the request made.

More



Using SetAccessRuleProtection

The SetAccessRuleProtection method is part of ObjectSecurity, which both FileSecurity and DirectorySecurity inherit from. You use to to govern how the object access rules behave in relation to inheritance.

More



Using SecurityAction Enumeration Flags

The SecurityAction enumeration is used in declarative security. Declarative security is when attributes are added to assemblies, class or methods. The below SecurityAction’s relate to the permssions of the calling assemblies: Demand This demands that assembly stack have the permissions required LinkDemand This demands that only the initial calling assembly has the permissions.

More



Using TraceSwitch

You can use the TraceSwitch class to control the detail of messages produced by your Trace statements. TraceSwitch does not directly control the Trace statements, you have to pass one of its properties into a WriteLineIf or WriteIf method.

More



XmlSerializer UnknownNode Event

The UnknownNode Event occurs when calling Deserialize and the xml contains nodes that do not exist in the type class. By default the XmlSerializer ignores unknown XML nodes, so this event gives you the ability to handle them.

More



Using ManagementClass

ManagementClass is a Common Information Model (CIM) management class. An example of a management class is a WMI class like Win32_LogicalDisk which hold information about the drives on a machine.

More



Using EventSourceCreationData

You can use EventSourceCreationData to register an application as a source for events. The EventSourceCreationData constructor takes the name of the Source which is your application name and a LogName which is the name of the category the EventLogEntry will be placed into, this can be Application, System, or a custom log name.

More



Prev