{"id":13824964,"url":"https://github.com/pgenfer/mixinSharp","last_synced_at":"2025-07-08T20:32:35.414Z","repository":{"id":122713111,"uuid":"51103320","full_name":"pgenfer/mixinSharp","owner":"pgenfer","description":"extension for VS2015 that adds mixins to C#","archived":false,"fork":false,"pushed_at":"2017-01-08T20:58:51.000Z","size":793,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-20T03:31:56.379Z","etag":null,"topics":["csharp","mixins","roslyn","visual-studio-extension"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pgenfer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-04T20:30:12.000Z","updated_at":"2021-07-15T07:45:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"2dacad13-7702-4d40-adb9-b72bb05418df","html_url":"https://github.com/pgenfer/mixinSharp","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/pgenfer/mixinSharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgenfer%2FmixinSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgenfer%2FmixinSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgenfer%2FmixinSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgenfer%2FmixinSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgenfer","download_url":"https://codeload.github.com/pgenfer/mixinSharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgenfer%2FmixinSharp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264343772,"owners_count":23593788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","mixins","roslyn","visual-studio-extension"],"created_at":"2024-08-04T09:01:12.703Z","updated_at":"2025-07-08T20:32:34.151Z","avatar_url":"https://github.com/pgenfer.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"# mixinSharp\n[![Build status](https://ci.appveyor.com/api/projects/status/u8nvb20x3y87h0ay?svg=true)](https://ci.appveyor.com/project/pgenfer/mixinsharp)\n[![Coverage Status](https://coveralls.io/repos/github/pgenfer/mixinSharp/badge.svg)](https://coveralls.io/github/pgenfer/mixinSharp)\n\nMixinSharp (or shorter: mixin#) is a code refactoring extension for Visual Studio 2015 that adds mixin support to C# by auto generating the required code.  \nThe VSIX binary installation file can be found in the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/05c8154b-eb71-45f1-986e-923acca556f1), the full source code is available here. \n\n## what are mixins?\n\nMixins are a software concept that provides code reuse by *composition* instead of *inheritance*.  \nThe code that should be reused is placed in a separate class (the *mixin*) and any other class (in this context also called a *child* class) that wants to use this code simply holds a reference to the mixin and delegates method calls to it.  \nFor the ouside standing caller it looks like that the child instance is handling the request directly.  \n \n## why are they useful?\n\nCompared to classical inheritance, mixins have some advantages. Please check the [wiki](https://github.com/pgenfer/mixinSharp/wiki/Mixins---An-Overview) for a more detailed comparison between the both approaches.  \nUnfortunately, C# does not support mixins directly on a language level, that's where mixinSharp comes into play by offering a refactoring step that automatically creates the required mixin code.\n\n## a simple example\n\nyour mixin class with the code you want to reuse\n```csharp\npublic class NameMixin\n{\n  public string Name { get; set; }\n  public override string ToString() =\u003e Name;\n}\n```\nthe class where you want to include your mixin (your child)\n```csharp\npublic class Person\n{\n  private NameMixin _name = new NameMixin();\n}\n```\nOpen the *Quick Action\" context menu while your cursor is on your ``` _name``` field declaration:    \n\n![Quick action](https://github.com/pgenfer/mixinSharp/blob/master/images/quick_action.png)    \n\nFrom the context menu that popped up, choose the entry *Include mixin: 'name'*    \n\n![Include mixin](https://github.com/pgenfer/mixinSharp/blob/master/images/mixin_preview.png)  \n\nAfter applying the mixin refactoring, your mixin class is included in your child:\n```csharp\npublic class Person\n{\n  private NameMixin _name = new NameMixin();\n  public string Name\n  {\n    get { return _name.Name; }\n    set { _name.Name = value; }\n  }\n  \n  public override string ToString() =\u003e _name.ToString();\n}\n```\n\n## Installation Instruction\nmixinSharp is a Visual Studio 2015 Extension (VSIX), as such it can be downloaded from the [Visual Studio Gallery](https://visualstudiogallery.msdn.microsoft.com/05c8154b-eb71-45f1-986e-923acca556f1).  \nAfter downloading the VSIX file, doubleclicking it will start the installation process.    \n\nTo compile the extension from source, you will have to install the [.NET Compiler Platform SDK](https://visualstudiogallery.msdn.microsoft.com/2ddb7240-5249-4c8c-969e-5d05823bcb89) first (but Visual Studio will automatically ask you to do so during the build).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgenfer%2FmixinSharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgenfer%2FmixinSharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgenfer%2FmixinSharp/lists"}