Releases: pgenfer/mixinSharp
Maintenance release
Event support
The following issues are implemented / fixed
Forwarding to mixin events is now supported:
If the mixin declares an event
public class NameMixin
{
public event EventHandler NameChanged;
}
The generated code will include the event in the child class and event access will be forwarded to the mixin:
// child class that includes the mixin
public class Person
{
private NameMixin _name = new NameMixin();
public event EventHandler NameChanged
{
add { _name.NameChanged += value; }
remove { _name.NameChanged -= value; }
}
}
Maintenance release
The following issues are fixed / implemented in this release:
The generated property code now avoids unnecessary line breaks, instead of
public string Name
{
get
{
return _name.Name;
}
set
{
_name.Name = value;
}
}
the generated accessor code will only take one line:
public string Name
{
get { return _name.Name; }
set { _name.Name = value; }
}
Interfaces can be implemented with mixins
The following product items are implemented in this solution:
#14
Opening the code refactoring menu over an interface gives you an option to implement this interface with a mixin.
Please check the Tutorial section for more details.
#16 (thanks to @aluanhaddad for providing the implementation)
mixinSharp will now also support Visual Studio 15 ( available as preview )
Add mixin's interface to interface list of child class
Feature #13 is now implemented:
The interfaces of a mixin can now be added to the interface list of the child class when the mixin is included into the child class.
Example:
// the following interface is available
public interface INamed
{
string Name { get; set; }
}
// a mixin implements this interface
public class NameMixin : INamed
{
// implementation omitted
}
If this mixin is now included in the following child class:
public class Person
{
private NameMixin _name;
}
The resulting child class will also provide the same interfaces as its mixin:
public class Person : INamed
{
private NameMixin _name;
// implementation omitted
}
Typenames will be reduced depending on the availability of using statements. If no corresponding using statements are available, full qualified type names will be used.
Optional constructor injection for mixins
A new optional feature is now avaiable:
Mixins can be automatically initialized via constructor injection. Check out the following code:
// BEFORE code refactoring:
// no initialization code for the mixin
public class Person
{
private NameMixin _name;
}
When the corresponding option is set, executing the refactoring step will lead to the following code:
// AFTER code refactoring:
// Constructor injection of the mixin instance
// was added to the class automatically.
public class Person
{
private NameMixin _name;
public Person(NameMixin name = null)
{
_name = name;
}
}
If the feature is enabled, mixinSharp will automatically generate the required constructor (or changes existing ones) and will inject an instance of the mixin through the constructor.
Please check out the Options section for more details.
Bugfix release
Options dialog for creating region directives and code documentation
Following features are available now:
- Options dialog
- Included mixin code can be surrounded by region directives (can be activated via options)
- Code documentation from mixin members can also be applied to fowarding methods (can be activated via options)
Minor bug fixes
Initial version (feature complete)
Version 1.0 is feature complete and production ready.