5 changed files with 674 additions and 0 deletions
@ -0,0 +1,207 @@
@@ -0,0 +1,207 @@
|
||||
<?xml version="1.0"?> |
||||
<Template author="William MacDonald" version="1.0"> |
||||
|
||||
<Config |
||||
name = "COM Component" |
||||
icon = "C#.File.Form" |
||||
category = "C#" |
||||
subcategory = "${res:Templates.File.Categories.WindowsApplications}" |
||||
defaultname = "COMComponent${Number}.cs" |
||||
language = "C#"/> |
||||
|
||||
<Description>A COM Component for use by other applications.</Description> |
||||
|
||||
<References> |
||||
<Reference include="System" /> |
||||
<Reference include="System.Drawing" /> |
||||
<Reference include="System.Windows.Forms" /> |
||||
</References> |
||||
|
||||
<!-- |
||||
Special new file templates: |
||||
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension |
||||
${FullName} -> Full generated path name |
||||
${FileName} -> File name with extension |
||||
${FileNameWithoutExtension} -> File name without extension |
||||
${Extension} -> Extension in the component ".cs" |
||||
${Path} -> Full path of the file |
||||
${ClassName} -> Class name (generally FileNameWithoutExtension w/o 'bad' characters) |
||||
--> |
||||
<Files> |
||||
<!-- Designer file must come first, so the design tab is shown correctly --> |
||||
<File name="${Path}/${FileNameWithoutExtension}.Designer.cs" DependentUpon="${FileName}" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
partial class ${ClassName} |
||||
{ |
||||
/// <summary> |
||||
/// Designer variable used to keep track of non-visual components. |
||||
/// </summary> |
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary> |
||||
/// Disposes resources used by the Component. |
||||
/// </summary> |
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// This method is required for Windows Component designer support. |
||||
/// Do not change the method contents inside the source code editor. The Forms designer might |
||||
/// not be able to load this method if it was changed manually. |
||||
/// </summary> |
||||
private void InitializeComponent() |
||||
{ |
||||
components = new System.ComponentModel.Container(); |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
/// <summary> |
||||
/// Description of ${ClassName}. |
||||
/// </summary> |
||||
[Guid(${ClassName}.guid${ClassName}), |
||||
ProgId("${StandardNamespace}.${ClassName}"), |
||||
ClassInterface(ClassInterfaceType.AutoDispatch), |
||||
ComSourceInterfaces(typeof(I${ClassName}Events)), |
||||
ComDefaultInterface(typeof(I${ClassName}Wrapper)), |
||||
ComVisible(true)] |
||||
public partial class ${ClassName} : Component, I${ClassName}Wrapper |
||||
{ |
||||
public const string guid${ClassName} = "${GUID}"; |
||||
public const string guidI${ClassName}Wrapper = "${GUID}"; |
||||
public const string guidI${ClassName}Events = "${GUID}"; |
||||
|
||||
private string name; |
||||
|
||||
public string Name |
||||
{ |
||||
get |
||||
{ |
||||
return this.name; |
||||
} |
||||
set |
||||
{ |
||||
this.name = value; |
||||
} |
||||
} |
||||
|
||||
public ${ClassName}() |
||||
{ |
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
|
||||
public ${ClassName}(IContainer container) |
||||
{ |
||||
container.Add(this); |
||||
|
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
|
||||
public void Open(string info) |
||||
{ |
||||
System.Console.Out.WriteLine("Open"); |
||||
} |
||||
|
||||
public void Close() |
||||
{ |
||||
if (this.Closing != null) |
||||
{ |
||||
this.Closing("Done"); |
||||
} |
||||
|
||||
System.Console.Out.WriteLine("Close"); |
||||
|
||||
if (this.Closed != null) |
||||
{ |
||||
this.Closed(); |
||||
} |
||||
} |
||||
|
||||
public event ${ClassName}EventHandler Closing; |
||||
|
||||
public event ${ClassName}EventHandler2 Closed; |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="${Path}/I${FileNameWithoutExtension}.cs" DependentUpon="${FileName}" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
public delegate void ${ClassName}EventHandler(string status); |
||||
|
||||
public delegate void ${ClassName}EventHandler2(); |
||||
|
||||
/// <summary> |
||||
/// Description of I${ClassName}Wrapper. |
||||
/// </summary> |
||||
[Guid(${ClassName}.guidI${ClassName}Wrapper), |
||||
InterfaceType(ComInterfaceType.InterfaceIsIDispatch), |
||||
ComVisible(true)] |
||||
public interface I${ClassName}Wrapper |
||||
{ |
||||
[DispId(10)] |
||||
string Name |
||||
{ |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
[DispId(30)] |
||||
void Open(string info); |
||||
|
||||
[DispId(31)] |
||||
void Close(); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Description of I${ClassName}Events. |
||||
/// </summary> |
||||
[Guid(${ClassName}.guidI${ClassName}Events), |
||||
InterfaceType(ComInterfaceType.InterfaceIsIDispatch), |
||||
ComVisible(true)] |
||||
public interface I${ClassName}Events |
||||
{ |
||||
[DispId(20)] |
||||
void Closing(string status); |
||||
|
||||
[DispId(21)] |
||||
void Closed(); |
||||
} |
||||
} |
||||
]]></File> |
||||
</Files> |
||||
|
||||
<AdditionalOptions/> |
||||
</Template> |
@ -0,0 +1,110 @@
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0"?> |
||||
<Template author="William MacDonald" version="1.0"> |
||||
|
||||
<Config |
||||
name = "Component" |
||||
icon = "C#.File.Form" |
||||
category = "C#" |
||||
subcategory = "${res:Templates.File.Categories.WindowsApplications}" |
||||
defaultname = "Component${Number}.cs" |
||||
language = "C#"/> |
||||
|
||||
<Description>A Component for an application.</Description> |
||||
|
||||
<References> |
||||
<Reference include="System" /> |
||||
<Reference include="System.ComponentModel" /> |
||||
</References> |
||||
|
||||
<!-- |
||||
Special new file templates: |
||||
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension |
||||
${FullName} -> Full generated path name |
||||
${FileName} -> File name with extension |
||||
${FileNameWithoutExtension} -> File name without extension |
||||
${Extension} -> Extension in the component ".cs" |
||||
${Path} -> Full path of the file |
||||
${ClassName} -> Class name (generally FileNameWithoutExtension w/o 'bad' characters) |
||||
--> |
||||
<Files> |
||||
<!-- Designer file must come first, so the design tab is shown correctly --> |
||||
<File name="${Path}/${FileNameWithoutExtension}.Designer.cs" DependentUpon="${FileName}" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
partial class ${ClassName} |
||||
{ |
||||
/// <summary> |
||||
/// Designer variable used to keep track of non-visual components. |
||||
/// </summary> |
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary> |
||||
/// Disposes resources used by the Component. |
||||
/// </summary> |
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// This method is required for Windows Component designer support. |
||||
/// Do not change the method contents inside the source code editor. The Forms designer might |
||||
/// not be able to load this method if it was changed manually. |
||||
/// </summary> |
||||
private void InitializeComponent() |
||||
{ |
||||
components = new System.ComponentModel.Container(); |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#} |
||||
using System; |
||||
using System.ComponentModel; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
/// <summary> |
||||
/// Description of ${ClassName}. |
||||
/// </summary> |
||||
public partial class ${ClassName} : Component |
||||
{ |
||||
public ${ClassName}() |
||||
{ |
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
|
||||
public ${ClassName}(IContainer container) |
||||
{ |
||||
container.Add(this); |
||||
|
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
</Files> |
||||
|
||||
<AdditionalOptions/> |
||||
</Template> |
||||
|
@ -0,0 +1,213 @@
@@ -0,0 +1,213 @@
|
||||
<?xml version="1.0"?> |
||||
<Template author = "William MacDonald" |
||||
created = "05/29/2014" |
||||
lastModified = "05/29/2014" |
||||
version = "1.0"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Windows COM Component Library</Name> |
||||
<Category>C#</Category> |
||||
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory> |
||||
<Icon>C#.Project.Form</Icon> |
||||
<Description>${res:Templates.Project.WindowsApplication.Description}</Description> |
||||
<SupportedTargetFrameworks>v2.0</SupportedTargetFrameworks> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "COMComponent1.cs"/> |
||||
</Actions> |
||||
|
||||
<Project language = "C#"> |
||||
<ProjectItems> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
</ProjectItems> |
||||
|
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||
<RegisterForComInterop>true</RegisterForComInterop> |
||||
</PropertyGroup> |
||||
|
||||
<Files> |
||||
<!-- Designer file must come first, so the design tab is shown correctly --> |
||||
<File name="COMComponent1.Designer.cs" DependentUpon="COMComponent1.cs" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
partial class COMComponent1 |
||||
{ |
||||
/// <summary> |
||||
/// Designer variable used to keep track of non-visual components. |
||||
/// </summary> |
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary> |
||||
/// Disposes resources used by the Component. |
||||
/// </summary> |
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// This method is required for Windows Component designer support. |
||||
/// Do not change the method contents inside the source code editor. The Forms designer might |
||||
/// not be able to load this method if it was changed manually. |
||||
/// </summary> |
||||
private void InitializeComponent() |
||||
{ |
||||
components = new System.ComponentModel.Container(); |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="COMComponent1.cs" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
using System; |
||||
using System.ComponentModel; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
/// <summary> |
||||
/// Description of COMComponent1. |
||||
/// </summary> |
||||
[Guid(COMComponent1.guidCOMComponent1), |
||||
ProgId("${StandardNamespace}.COMComponent1"), |
||||
ClassInterface(ClassInterfaceType.AutoDispatch), |
||||
ComSourceInterfaces(typeof(ICOMComponent1Events)), |
||||
ComDefaultInterface(typeof(ICOMComponent1Wrapper)), |
||||
ComVisible(true)] |
||||
public partial class COMComponent1 : Component, ICOMComponent1Wrapper |
||||
{ |
||||
public const string guidCOMComponent1 = "${GUID}"; |
||||
public const string guidICOMComponent1Wrapper = "${GUID}"; |
||||
public const string guidICOMComponent1Events = "${GUID}"; |
||||
|
||||
private string name; |
||||
|
||||
public string Name |
||||
{ |
||||
get |
||||
{ |
||||
return this.name; |
||||
} |
||||
set |
||||
{ |
||||
this.name = value; |
||||
} |
||||
} |
||||
|
||||
public COMComponent1() |
||||
{ |
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
|
||||
public COMComponent1(IContainer container) |
||||
{ |
||||
container.Add(this); |
||||
|
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
|
||||
public void Open(string info) |
||||
{ |
||||
System.Console.Out.WriteLine("Open"); |
||||
} |
||||
|
||||
public void Close() |
||||
{ |
||||
if (this.Closing != null) |
||||
{ |
||||
this.Closing("Done"); |
||||
} |
||||
|
||||
System.Console.Out.WriteLine("Close"); |
||||
|
||||
if (this.Closed != null) |
||||
{ |
||||
this.Closed(); |
||||
} |
||||
} |
||||
|
||||
public event COMComponent1EventHandler Closing; |
||||
|
||||
public event COMComponent1EventHandler2 Closed; |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="ICOMComponent1.cs" DependentUpon="COMComponent1.cs" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
public delegate void COMComponent1EventHandler(string status); |
||||
|
||||
public delegate void COMComponent1EventHandler2(); |
||||
|
||||
/// <summary> |
||||
/// Description of ICOMComponent1Wrapper. |
||||
/// </summary> |
||||
[Guid(COMComponent1.guidICOMComponent1Wrapper), |
||||
InterfaceType(ComInterfaceType.InterfaceIsIDispatch), |
||||
ComVisible(true)] |
||||
public interface ICOMComponent1Wrapper |
||||
{ |
||||
[DispId(10)] |
||||
string Name |
||||
{ |
||||
get; |
||||
set; |
||||
} |
||||
|
||||
[DispId(30)] |
||||
void Open(string info); |
||||
|
||||
[DispId(31)] |
||||
void Close(); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Description of ICOMComponent1Events. |
||||
/// </summary> |
||||
[Guid(COMComponent1.guidICOMComponent1Events), |
||||
InterfaceType(ComInterfaceType.InterfaceIsIDispatch), |
||||
ComVisible(true)] |
||||
public interface ICOMComponent1Events |
||||
{ |
||||
[DispId(20)] |
||||
void Closing(string status); |
||||
|
||||
[DispId(21)] |
||||
void Closed(); |
||||
} |
||||
} |
||||
]]></File> |
||||
|
||||
<File name="Properties\AssemblyInfo.cs" src="DefaultCOMAssemblyInfo.cs"/> |
||||
</Files> |
||||
</Project> |
||||
</Template> |
@ -0,0 +1,113 @@
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0"?> |
||||
<Template author = "William MacDonald" |
||||
created = "05/29/2014" |
||||
lastModified = "05/29/2014" |
||||
version = "1.0"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Windows Component Library</Name> |
||||
<Category>C#</Category> |
||||
<Subcategory>${res:Templates.File.Categories.WindowsApplications}</Subcategory> |
||||
<Icon>C#.Project.Form</Icon> |
||||
<Description>${res:Templates.Project.WindowsApplication.Description}</Description> |
||||
<SupportedTargetFrameworks>v2.0;v3.5Client</SupportedTargetFrameworks> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "Component.cs"/> |
||||
</Actions> |
||||
|
||||
<Project language = "C#"> |
||||
<ProjectItems> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.ComponentModel" /> |
||||
</ProjectItems> |
||||
|
||||
<PropertyGroup> |
||||
<OutputType>WinExe</OutputType> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||
</PropertyGroup> |
||||
|
||||
<Files> |
||||
<!-- Designer file must come first, so the design tab is shown correctly --> |
||||
<File name="Component1.Designer.cs" DependentUpon="Component1.cs" language="C#"><![CDATA[${StandardHeader.C#} |
||||
namespace ${StandardNamespace} |
||||
{ |
||||
partial class Component1 |
||||
{ |
||||
/// <summary> |
||||
/// Designer variable used to keep track of non-visual components. |
||||
/// </summary> |
||||
private System.ComponentModel.IContainer components = null; |
||||
|
||||
/// <summary> |
||||
/// Disposes resources used by the Component. |
||||
/// </summary> |
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose(disposing); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// This method is required for Windows Component designer support. |
||||
/// Do not change the method contents inside the source code editor. The Forms designer might |
||||
/// not be able to load this method if it was changed manually. |
||||
/// </summary> |
||||
private void InitializeComponent() |
||||
{ |
||||
components = new System.ComponentModel.Container(); |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="Component1.cs" language="C#"><![CDATA[${StandardHeader.C#} |
||||
using System; |
||||
using System.ComponentModel; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
/// <summary> |
||||
/// Description of Component1. |
||||
/// </summary> |
||||
public partial class Component1 : Component |
||||
{ |
||||
public Component1() |
||||
{ |
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
|
||||
public Component1(IContainer container) |
||||
{ |
||||
container.Add(this); |
||||
|
||||
// |
||||
// The InitializeComponent() call is required for Windows Forms designer support. |
||||
// |
||||
InitializeComponent(); |
||||
|
||||
// |
||||
// TODO: Add constructor code after the InitializeComponent() call. |
||||
// |
||||
} |
||||
} |
||||
} |
||||
]]></File> |
||||
<File name="Properties\AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/> |
||||
</Files> |
||||
</Project> |
||||
</Template> |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
#region Using directives
|
||||
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
#endregion
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("${ProjectName}")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("${ProjectName}")] |
||||
[assembly: AssemblyCopyright("Copyright ${DATE:yyyy}")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(true)] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all the values or you can use the default the Revision and
|
||||
// Build Numbers by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")] |
Loading…
Reference in new issue