Projects tagged ‘postsharp’


[9 total ]

14 Users
   

DataObjects.Net v4.0 is rapid database application development framework. It combines comprehensive business logic layer development framework, object-relational mapper and a set of storage ... [More] implementations enabling the same BLL code work everywhere dramatically reducing the resources and time you need to develop generally any application dealing with persistent data. [Less]
Created 11 months ago.

0 Users

code-o-maticThe code-o-matic library leverages the PostSharp platform to implement code injection mechanisms for .NET. Code is injected through custom attributes that perform various tasks, such as ... [More] parameter validation, common patterns implementation, etc. The current version of code-o-matic offers the following mechanisms: Validation - Validate method parameters and properties by applying custom attributes such as NotNull or Pattern. Automatic properties - Automatically implement ViewState and Session properties on your ASP.NET controls and pages. See the GettingStarted page to get started. RequirementsCode-o-matic is based on PostSharp 1.0. You will need to download and install it for code-o-matic to work. An installer is supplied that can optionally install the correct version of PostSharp for you. NOTE: Postsharp is only required for compiling the code. The production environment does not need to have Postsharp installed. For performance reasons, the validation library is implemented as a Postsharp plugin. An installer is provided that copies the plugin files in the correct folder. It is also possible to copy the files manually. See the CompilingInstructions page for more informations. DocumentationThe following pages contain examples of use for the various parts of code-o-matic. ValidationExamples [Less]
Created 9 months ago.

0 Users

Enhances the Spring.NET framework by build-time assembly enhancement using PostSharp. If you want to contribute to this project, please write a message using the form ... [More] http://www.postsharp.org/author/gfraiteur (communicate your Google account name). [Less]
Created about 1 year ago.

0 Users

ValidationAspects provides State and Interception validation on .net Objects, Properties and Method Parameters. Validation can be declared via attributes and/or augmented/replaced with validation ... [More] functions at runtime. Supports asp.net MVC, WPF, Silverlight, PostSharp, and Unity. [Less]
Created 10 months ago.

0 Users

This is where I'm hosting the code for samples I post to my blog, Continuous Disintegration. -Ryan Gray
Created 11 months ago.

0 Users

A collection of PostSharp samples written by their users. If you want to post your code, please see the InstructionsForAuthors. If you are interested in this group, consider becoming a member of the ... [More] Google Group of this project. ProjectsThe following projects have already been submitted: (authors, please update this list!) Visual Basic 8FirstStep: Inject a code block, at the beginning of each method call. MethodBoundaryAspect: Demonstrates code injection on method level FieldAccessAspect: Demonstrates code injection on field level LittlePerformanceTest: Gives some idea about the runtime costs of enhancing CacheAspect: Let PostSharp add a cache behind your objects functions DataBindingSupport: Implement common interfaces on the fly OpenAccess: Check out the teamwork of two different enhancer frameworks C# V3.5 Validators: A collection of basic attributes for Property-level setter-validation. [Less]
Created 11 months ago.

0 Users

Plug-ins and Aspect Libraries contributed by the PostSharp community. This project currently contains the following components: Log4PostSharp: trace your programs using a single custom attribute. ... [More] Log4PostSharp emits optimal instructions for you. Yes, just like hand-tuned code! PostSharp4Unity: Mark classes as configurable and start enjoying Unity without the factory method! Old plain constructor still work. PostSharpAspNet: Enables to use PostSharp in ASP.NET projects even with JIT compilation. DesignByContract: transparently adds preconditions, postconditions and invariant to methods and classes. Just beginning, a lot of work to do. Awareness: makes PostSharp Laos aware of serialization (BinaryFormatter and WCF). GSharp: One of the classic uses of AOP is to automate logging. But an unfortunate side-effect of logging everywhere is massive log files that are hard to read, hard to dig around in, and sometimes hard to just open without running out of memory. GSharp aspects let you trace your programs as well as log exceptions and profile performance. You can then analyze and graph your data with Gibraltar. [Less]
Created about 1 year ago.

0 Users

A plug-in for PostSharp aimed to automate state management in ASP.NET controls. It enables storing field / properties values of controls just by decorating them with custom attribute. One can also ... [More] decide if he wants to store value in ViewState or ControlState. [Less]
Created 9 months ago.

0 Users

PropFuPropFu is a plugin for PostSharp that eliminates the mind numbing and somewhat risky repetition of declaring properties that support INotifyPropertyChanged. If you work with WPF, or WinForms ... [More] you know how painful this can be. With this simple plugin to the PostSharp aspect library all of your properties can magically be turned into automatic properties without a backing field, and all of your properties will call a method of your choosing to fire the PropertyChanged event. All you need to do is add one attribute to the top of your class, and one attribute to the method that will fire the event (usually in a thin, common base class) and you're done! Everything is done at compile time and you will receive absolutely no runtime performance hit. Once you start using this technique you'll never go back. Note: This can be used in commercial/closed source software as the only code you will be linking to directly in your project is under the MIT license. The plug-in is GPL, but that does not transfer over to an app modified by the plugin: http://www.postsharp.org/forum/post1416.html#p1416 Here's what you had to do before: public class PersonLame : INotifyPropertyChanged { private string _name; public string Name { get { return _name; } set { if (value == _name) return; _name = value; OnPropertyChanged("Name"); } } private int _age; public int Age { get { return _age; } set { if (value == _age) return; _age = value; OnPropertyChanged("Age"); } } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion private void OnPropertyChanged(string propertyName) { if (PropertyChanged == null) return; PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }Here's the same as above using PropFu: [NotifyPropertyChanged] public class PersonAwesome : INotifyPropertyChanged { public string Name { get; set; } public int Age { get; set; } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion [OnPropertyChanged] private void OnPropertyChanged(string propertyName) { if (PropertyChanged == null) return; PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }How it works: You simply mark classes with the NotifyPropertyChanged attribute, when you want to have properties that fire the property changed event. You mark a method, anywhere in your class hierarchy with the OnPropertyChangedAttribute, and that method will be called when the property value is changed. The system even injects a guard clause that checks to see if the value has changed. Notes: This works even when you do not use automatic properties. Only properties with public getters, and any kind of setter will fire property changes. Guard clauses are injected in your setters, so if the value being sent in is the same, the code in your setter will not get executed. (You shouldn't be doing anything in your setter that changes the state of your object when the same value is passed in anyway.) InstallationWhen PostSharp is installedCopy files PropFu.psplugin, PropFu.Weaver.dll, and PropFu.dll into C:\Program Files\PostSharp 1.0\PlugIns (for global installation) or C:\Documents and Settings\userName\Application Data\PostSharp 1.0 (user-only installation). You need to link to the PropFu.dll in your code to get access to the attributes. When you are using only the binaries of PostSharpIf you are going to have PropFu, and PostSharp checked into your source control system, and do not wish to make all your developers/build machines install PostSharp, you need to do a bit of manual work per project. To inject aspects into an assembly, PostSharp waits for the project to compile, and then during post-build reads in the assemblies and starts weaving code at the IL level. To make this happen, you need to do the following: Add a reference to PostSharp.Public in your project. For example sake, let's say you have your binaries extracted to: C:\PostSharp Open the .csproj that will be using aspects in notepad. Locate this line near the bottom of the file: You need to put a property group before the above line that tells PostSharp not to link in the PostSharp.Public or PostSharp.Laos DLLs into your assembly, and import the PostSharp.targets file. Only use relative paths when pointing to the targets file in order to work correctly with source control. You basically sandwich the above line and end up with this: True You probably need to change the relative path in the above snippet, depending on where your project is located relative to PostSharp directory. [Less]
Created 3 months ago.