[commit] r1158 - in trunk/SDK/DotNet/CSharpComponentWizard/Templates: CSharpAddon CSharpInterpreter
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Wed Feb 9 12:53:29 CST 2011
Author: ksmyth
Date: Wed Feb 9 12:53:29 2011
New Revision: 1158
Log:
Extract zips so the source code is under version control
Added:
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/AssemblyInfo.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/ComponentConfig.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/GMEConsole.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/MyAddon.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/Registrar.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/classlibrary.csproj (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/csClassLibrary.vstemplate (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/AssemblyInfo.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/Component.ico (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/ComponentConfig.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/GMEConsole.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/MgaGateway.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/MyInterpreter.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/Registrar.cs (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/classlibrary.csproj (contents, props changed)
trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/csClassLibrary.vstemplate (contents, props changed)
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/AssemblyInfo.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/AssemblyInfo.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 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("$registeredorganization$")]
+[assembly: AssemblyProduct("$projectname$")]
+[assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("$guid1$")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/ComponentConfig.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/ComponentConfig.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,27 @@
+using System;
+using System.Runtime.InteropServices;
+using MGAUtilLib;
+using MGALib;
+
+namespace GME.CSharp
+{
+
+ abstract class ComponentConfig
+ {
+ // Set paradigm name. Provide * if you want to register it for all paradigms.
+ public const string paradigmName = "$paradigmname$";
+
+ // Set the human readable name of the addon. You can use white space characters.
+ public const string componentName = "$componentname$";
+
+ // Select the object events you want the addon to listen to.
+ public const int eventMask = (int)($eventmask$);
+
+ // Uncomment the flag if your component is paradigm independent.
+ public static componenttype_enum componentType = componenttype_enum.COMPONENTTYPE_ADDON;
+
+ public const regaccessmode_enum registrationMode = regaccessmode_enum.$regaccessmode$;
+ public const string progID = "MGA.Addon.$progid$";
+ public const string guid = "$guid$";
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/GMEConsole.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/GMEConsole.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,137 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using GmeLib;
+
+namespace GME.CSharp
+{
+ /// <summary>
+ /// Automatically redirects console messages to the GME console output, if GME is available.
+ /// Otherwise prints the output to System console.
+ /// </summary>
+ public static class GMEConsole
+ {
+
+ /// <summary>
+ /// The GME application variable
+ /// </summary>
+ static public IGMEOLEApp gme = null;
+ private static GMETextWriter error = new GMETextWriter(msgtype_enum.MSG_ERROR);
+ private static GMETextWriter warning = new GMETextWriter(msgtype_enum.MSG_WARNING);
+ private static GMETextWriter info = new GMETextWriter(msgtype_enum.MSG_INFO);
+ private static GMETextWriter normal = new GMETextWriter(msgtype_enum.MSG_NORMAL);
+
+ /// <summary>
+ /// Handles error messages
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Error.Write("RootFolder name error: {0}.", rf.Name);
+ /// If console is initialized, the message appears in GME console, if not, then in standard error.
+ /// If DEBUG is defined, it also appears in VS output window.
+ /// </summary>
+ public static TextWriter Error
+ {
+
+ get { return error; }
+ }
+
+ /// <summary>
+ /// Prints messages.
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Out.Write("RootFolder name : {0}.", rf.Name);
+ /// </summary>
+ public static TextWriter Out
+ {
+
+ get { return normal; }
+ }
+
+
+ /// <summary>
+ /// Prints warning messages.
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Warning.Write("RootFolder name is not changed : {0}.", rf.Name);
+ /// </summary>
+ public static TextWriter Warning
+ {
+
+ get { return warning; }
+ }
+
+
+
+ /// <summary>
+ /// Proints info messages.
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Info.Write("RootFolder name is changed : {0}.", rf.Name);
+ /// </summary>
+ public static TextWriter Info
+ {
+ get { return info; }
+ }
+
+ /// <summary>
+ /// Clear the console
+ /// </summary>
+ public static void Clear()
+ {
+ if (gme != null)
+ gme.ConsoleClear();
+ else
+ System.Console.Clear();
+ }
+
+ }
+
+
+ public class GMETextWriter : System.IO.TextWriter
+ {
+ private msgtype_enum type;
+
+ public GMETextWriter(msgtype_enum type)
+ {
+ this.type = type;
+ }
+
+ override public Encoding Encoding
+ {
+ get {return Encoding.ASCII;}
+
+ }
+
+ override public void WriteLine(string str)
+ {
+ Write(str + Environment.NewLine);
+ }
+
+ override public void Write(string str)
+ {
+ if (GMEConsole.gme == null)
+ {
+ switch (type)
+ {
+ case msgtype_enum.MSG_NORMAL:
+ Console.Out.Write(str);
+ break;
+ case msgtype_enum.MSG_INFO:
+ Console.Out.Write("Information: " + str);
+ break;
+ case msgtype_enum.MSG_WARNING:
+ Console.Out.Write("Warning: " + str);
+ break;
+ case msgtype_enum.MSG_ERROR:
+ Console.Error.Write(str);
+ #if(DEBUG)
+ System.Diagnostics.Debug.Write(str);
+ #endif
+ break;
+ }
+ }
+ else
+ {
+ GMEConsole.gme.ConsoleMessage(str, type);
+ }
+ }
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/MyAddon.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/MyAddon.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,198 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.IO;
+using GME.CSharp;
+using MGALib;
+using GmeLib;
+using MGACoreLib;
+
+namespace GME.CSharp.MyAddon
+{
+ [Guid(ComponentConfig.guid),
+ ProgId(ComponentConfig.progID),
+ ClassInterface(ClassInterfaceType.AutoDual)]
+ [ComVisible(true)]
+ public class MyAddon : IMgaComponentEx, IGMEVersionInfo, IMgaEventSink
+ {
+
+ private MgaAddOn addon;
+ private bool componentEnabled = true;
+
+ // Event handlers for addons
+ #region MgaEventSink members
+ public void GlobalEvent(globalevent_enum @event)
+ {
+ if (!componentEnabled)
+ {
+ return;
+ }
+
+ // TODO: Handle global events
+
+ MessageBox.Show(@event.ToString());
+ }
+
+ public void ObjectEvent(MgaObject subject /* the object the event(s) happened to */,
+ uint eventMask /* events ORed together */, object param /* not used */)
+ {
+ if (!componentEnabled)
+ {
+ return;
+ }
+
+ // TODO: Handle object events (OR eventMask with the members of objectevent_enum)
+ // Warning: Only those events are received that you have subscribed for by setting ComponentConfig.eventMask
+
+ MessageBox.Show(eventMask.ToString());
+
+ }
+
+ #endregion
+
+ #region IMgaComponentEx Members
+
+ public void Initialize(MgaProject p)
+ {
+ // Creating addon
+ p.CreateAddOn(this, out addon);
+ // Setting event mask (see ComponentConfig.eventMask)
+ unchecked
+ {
+ addon.EventMask = (uint)ComponentConfig.eventMask;
+ }
+ }
+
+ public void InvokeEx(MgaProject project, MgaFCO currentobj, MgaFCOs selectedobjs, int param)
+ {
+ throw new NotImplementedException(); // Not called by addon
+ }
+
+
+ #region Component Information
+ public string ComponentName
+ {
+ get { return GetType().Name; }
+ }
+
+ public string ComponentProgID
+ {
+ get
+ {
+ return ComponentConfig.progID;
+ }
+ }
+
+ public componenttype_enum ComponentType
+ {
+ get { return ComponentConfig.componentType; }
+ }
+ public string Paradigm
+ {
+ get { return ComponentConfig.paradigmName; }
+ }
+ #endregion
+
+ #region Enabling
+ bool enabled = true;
+ public void Enable(bool newval)
+ {
+ enabled = newval;
+ }
+ #endregion
+
+ #region Interactive Mode
+ protected bool interactiveMode = true;
+ public bool InteractiveMode
+ {
+ get
+ {
+ return interactiveMode;
+ }
+ set
+ {
+ interactiveMode = value;
+ }
+ }
+ #endregion
+
+ #region Custom Parameters
+ SortedDictionary<string, object> componentParameters = null;
+
+ public object get_ComponentParameter(string Name)
+ {
+ if (Name == "type")
+ return "csharp";
+
+ if (Name == "path")
+ return GetType().Assembly.Location;
+
+ if (Name == "fullname")
+ return GetType().FullName;
+
+ object value;
+ if(componentParameters!= null && componentParameters.TryGetValue(Name, out value))
+ {
+ return value;
+ }
+
+ return null;
+ }
+
+ public void set_ComponentParameter(string Name, object pVal)
+ {
+ if (componentParameters == null)
+ {
+ componentParameters = new SortedDictionary<string, object>();
+ }
+
+ componentParameters[Name] = pVal;
+ }
+ #endregion
+
+ #region Unused Methods
+ // Old interface, it is never called for MgaComponentEx interfaces
+ public void Invoke(MgaProject Project, MgaFCOs selectedobjs, int param)
+ {
+ throw new NotImplementedException();
+ }
+
+ // Not used by GME
+ public void ObjectsInvokeEx(MgaProject Project, MgaObject currentobj, MgaObjects selectedobjs, int param)
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #endregion
+
+ #region IMgaVersionInfo Members
+
+ public GMEInterfaceVersion_enum version
+ {
+ get { return GMEInterfaceVersion_enum.GMEInterfaceVersion_Current; }
+ }
+
+ #endregion
+
+ #region Registration Helpers
+
+ [ComRegisterFunctionAttribute]
+ public static void GMERegister(Type t)
+ {
+ Registrar.RegisterComponentsInGMERegistry();
+
+ }
+
+ [ComUnregisterFunctionAttribute]
+ public static void GMEUnRegister(Type t)
+ {
+ Registrar.UnregisterComponentsInGMERegistry();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/Registrar.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/Registrar.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using MGAUtilLib;
+using MGALib;
+using GmeLib;
+using MGACoreLib;
+using Microsoft.Win32;
+
+namespace GME.CSharp
+{
+ [ComVisible(false)]
+ public class RegistrationException : ApplicationException
+ {
+ public RegistrationException(string message):base(message){}
+ }
+
+ [ComVisible(false)]
+ public class Registrar
+ {
+
+ public Registrar()
+ {
+ }
+
+
+ public static void RegisterComponentsInGMERegistry()
+ {
+ try
+ {
+ MgaRegistrar registrar = new MgaRegistrar();
+ if ((int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((IGMEVersionInfo)registrar).version)
+ {
+ throw new RegistrationException("GMEInterfaceVersion mismatch: this assembly is using " +
+ (int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
+ " but the GME interface version is " + (int)((IGMEVersionInfo)registrar).version +
+ "\n\nPlease install a compatible GME version or update the interop dlls.");
+ }
+
+ registrar.RegisterComponent(ComponentConfig.progID, ComponentConfig.componentType, ComponentConfig.componentName, ComponentConfig.registrationMode);
+
+ if (!ComponentConfig.paradigmName.Equals("*"))
+ {
+ registrar.Associate(
+ ComponentConfig.progID,
+ ComponentConfig.paradigmName,
+ ComponentConfig.registrationMode);
+ }
+ }
+ catch (Exception e)
+ {
+ System.Windows.Forms.MessageBox.Show(e.Message);
+ }
+
+ }
+
+
+ public static void UnregisterComponentsInGMERegistry()
+ {
+ try
+ {
+
+ MgaRegistrar registrar = new MgaRegistrar();
+ if ((int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((IGMEVersionInfo)registrar).version)
+ {
+ throw new RegistrationException("GMEInterfaceVersion mismatch: this assembly is using " +
+ (int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
+ " but the GME interface version is " + (int)((IGMEVersionInfo)registrar).version +
+ "\n\nPlease install a compatible GME version or update the interop dlls.");
+ }
+
+ registrar.UnregisterComponent(ComponentConfig.progID, ComponentConfig.registrationMode);
+
+ }
+ catch (Exception e)
+ {
+ System.Windows.Forms.MessageBox.Show(e.Message);
+ }
+
+ }
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/classlibrary.csproj
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/classlibrary.csproj Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>$guid1$</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>$safeprojectname$</RootNamespace>
+ <AssemblyName>$safeprojectname$</AssemblyName>
+ <TargetFrameworkVersion>v$targetframeworkversion$</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <RegisterForComInterop>true</RegisterForComInterop>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <RegisterForComInterop>true</RegisterForComInterop>
+ </PropertyGroup>
+ <!--DELETE
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>AssemblySignature.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ DELETE-->
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ComponentConfig.cs" />
+ <Compile Include="MyAddon.cs" />
+ <Compile Include="Registrar.cs" />
+ <Compile Include="GMEConsole.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <!--$ADDITIONALFILES$-->
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="CORELib">
+ <Guid>{9E9AAACF-28B8-11D3-B36C-0060082DF884}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="GmeLib">
+ <Guid>{0ADEEC71-D83A-11D3-B36B-005004CC8592}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="METALib">
+ <Guid>{0ADEEC71-D83A-11D3-B36B-005004D38590}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="MGALib">
+ <Guid>{270B4F86-B17C-11D3-9AD1-00AA00B6FE26}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="MGAUTILLib">
+ <Guid>{461F30AE-3BF0-11D4-B3F0-005004D38590}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ </ItemGroup>
+ <!--DELETE
+ <ItemGroup>
+ <None Include="AssemblySignature.snk" />
+ </ItemGroup>
+ DELETE-->
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+
+ <!--
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/csClassLibrary.vstemplate
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpAddon/csClassLibrary.vstemplate Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
+ <TemplateData>
+ <Name>CSharpAddonTemplate</Name>
+ <Description>GME CSharp Addon Template</Description>
+ <ProjectType>CSharp</ProjectType>
+ <ProjectSubType>
+ </ProjectSubType>
+ <SortOrder>20</SortOrder>
+ <CreateNewFolder>true</CreateNewFolder>
+ <DefaultName>Simple</DefaultName>
+ <ProvideDefaultName>true</ProvideDefaultName>
+ <LocationField>Enabled</LocationField>
+ <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
+ <Icon>__TemplateIcon.ico</Icon>
+ </TemplateData>
+ <TemplateContent>
+ <Project File="ClassLibrary.csproj" ReplaceParameters="true">
+ <ProjectItem ReplaceParameters="true" TargetFileName="Properties\AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">ComponentConfig.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">MyAddon.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">Registrar.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">GMEConsole.cs</ProjectItem>
+ </Project>
+ </TemplateContent>
+</VSTemplate>
\ No newline at end of file
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/AssemblyInfo.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/AssemblyInfo.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 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("$registeredorganization$")]
+[assembly: AssemblyProduct("$projectname$")]
+[assembly: AssemblyCopyright("Copyright © $registeredorganization$ $year$")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("$guid1$")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/Component.ico
==============================================================================
Binary file. No diff available.
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/ComponentConfig.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/ComponentConfig.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,30 @@
+using System;
+using System.Runtime.InteropServices;
+using MGAUtilLib;
+using MGALib;
+
+namespace GME.CSharp
+{
+
+ abstract class ComponentConfig
+ {
+ // Set paradigm name. Provide * if you want to register it for all paradigms.
+ public const string paradigmName = "$paradigmname$";
+
+ // Set the human readable name of the interpreter. You can use white space characters.
+ public const string componentName = "$componentname$";
+
+ // Specify an icon path
+ public const string iconName = "$iconname$";
+
+ // If null, updated with the assembly path + the iconName dynamically on registration
+ public static string iconPath = $iconpath$;
+
+ // Uncomment the flag if your component is paradigm independent.
+ public static componenttype_enum componentType = componenttype_enum.COMPONENTTYPE_$componenttype$;
+
+ public const regaccessmode_enum registrationMode = regaccessmode_enum.$regaccessmode$;
+ public const string progID = "MGA.Interpreter.$progid$";
+ public const string guid = "$guid$";
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/GMEConsole.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/GMEConsole.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,137 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using GmeLib;
+
+namespace GME.CSharp
+{
+ /// <summary>
+ /// Automatically redirects console messages to the GME console output, if GME is available.
+ /// Otherwise prints the output to System console.
+ /// </summary>
+ public static class GMEConsole
+ {
+
+ /// <summary>
+ /// The GME application variable
+ /// </summary>
+ static public IGMEOLEApp gme = null;
+ private static GMETextWriter error = new GMETextWriter(msgtype_enum.MSG_ERROR);
+ private static GMETextWriter warning = new GMETextWriter(msgtype_enum.MSG_WARNING);
+ private static GMETextWriter info = new GMETextWriter(msgtype_enum.MSG_INFO);
+ private static GMETextWriter normal = new GMETextWriter(msgtype_enum.MSG_NORMAL);
+
+ /// <summary>
+ /// Handles error messages
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Error.Write("RootFolder name error: {0}.", rf.Name);
+ /// If console is initialized, the message appears in GME console, if not, then in standard error.
+ /// If DEBUG is defined, it also appears in VS output window.
+ /// </summary>
+ public static TextWriter Error
+ {
+
+ get { return error; }
+ }
+
+ /// <summary>
+ /// Prints messages.
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Out.Write("RootFolder name : {0}.", rf.Name);
+ /// </summary>
+ public static TextWriter Out
+ {
+
+ get { return normal; }
+ }
+
+
+ /// <summary>
+ /// Prints warning messages.
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Warning.Write("RootFolder name is not changed : {0}.", rf.Name);
+ /// </summary>
+ public static TextWriter Warning
+ {
+
+ get { return warning; }
+ }
+
+
+
+ /// <summary>
+ /// Proints info messages.
+ /// The message to be written. GME Console does not handle special characters and trims white-spaces.
+ /// Example: GMEConsole.Info.Write("RootFolder name is changed : {0}.", rf.Name);
+ /// </summary>
+ public static TextWriter Info
+ {
+ get { return info; }
+ }
+
+ /// <summary>
+ /// Clear the console
+ /// </summary>
+ public static void Clear()
+ {
+ if (gme != null)
+ gme.ConsoleClear();
+ else
+ System.Console.Clear();
+ }
+
+ }
+
+
+ public class GMETextWriter : System.IO.TextWriter
+ {
+ private msgtype_enum type;
+
+ public GMETextWriter(msgtype_enum type)
+ {
+ this.type = type;
+ }
+
+ override public Encoding Encoding
+ {
+ get {return Encoding.ASCII;}
+
+ }
+
+ override public void WriteLine(string str)
+ {
+ Write(str + Environment.NewLine);
+ }
+
+ override public void Write(string str)
+ {
+ if (GMEConsole.gme == null)
+ {
+ switch (type)
+ {
+ case msgtype_enum.MSG_NORMAL:
+ Console.Out.Write(str);
+ break;
+ case msgtype_enum.MSG_INFO:
+ Console.Out.Write("Information: " + str);
+ break;
+ case msgtype_enum.MSG_WARNING:
+ Console.Out.Write("Warning: " + str);
+ break;
+ case msgtype_enum.MSG_ERROR:
+ Console.Error.Write(str);
+ #if(DEBUG)
+ System.Diagnostics.Debug.Write(str);
+ #endif
+ break;
+ }
+ }
+ else
+ {
+ GMEConsole.gme.ConsoleMessage(str, type);
+ }
+ }
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/MgaGateway.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/MgaGateway.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using MGALib;
+using GmeLib;
+using MGAMetaLib;
+using MGACoreLib;
+
+namespace GME.CSharp
+{
+ static class MgaGateway
+ {
+ public static IMgaProject project = null;
+ public static IMgaTerritory territory = null;
+ // TODO: Add your static variables here.
+ // Never forget to initialize static variables in each invocation of the component.
+ // Static variables preserves their values across the invocations from the same GME process.
+
+
+ // TODO: Add your generic MGA access functions here
+#region TRANSACTION HANDLING
+ public static void BeginTransaction(transactiontype_enum mode = transactiontype_enum.TRANSACTION_GENERAL)
+ {
+ project.BeginTransaction(territory, mode);
+ }
+
+ public static void CommitTransaction()
+ {
+ project.CommitTransaction();
+ }
+
+ public static void AbortTransaction()
+ {
+ project.AbortTransaction();
+ }
+#endregion
+#region UTILITIES
+ public static IMgaMetaBase GetMetaByName(string name)
+ {
+ try
+ {
+ return project.RootMeta.RootFolder.get_DefinedFCOByName(name, false) as MgaMetaFCO;
+ }
+#pragma warning disable 0168
+ catch (System.Runtime.InteropServices.COMException e)
+ {
+ return project.RootMeta.RootFolder.get_DefinedFolderByName(name, false) as MgaMetaFolder;
+ }
+#pragma warning restore 0168
+ }
+
+#endregion
+
+
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/MyInterpreter.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/MyInterpreter.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,293 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Windows.Forms;
+using MGACoreLib;
+using GME.CSharp;
+using GmeLib;
+using MGALib;
+
+namespace GME.CSharp.MyInterpreter
+{
+ /// <summary>
+ /// This class implements the necessary COM interfaces for a GME interpreter component. Nonstatic variables in this class
+ /// are initialized with each invocation, static members are not, and they preserve their value across calls from the same GME process.
+ /// This is true for all classes in your component.
+ /// </summary>
+ [Guid(ComponentConfig.guid),
+ ProgId(ComponentConfig.progID),
+ ClassInterface(ClassInterfaceType.AutoDual)]
+ [ComVisible(true)]
+ public class MyInterpreter : IMgaComponentEx, IGMEVersionInfo
+ {
+ /// <summary>
+ /// Contains information about the GUI event that initiated the invocation.
+ /// </summary>
+ public enum ComponentStartMode
+ {
+ GME_MAIN_START = 0, // Not used by GME
+ GME_BROWSER_START = 1, // Right click in the GME Tree Browser window
+ GME_CONTEXT_START = 2, // Using the context menu by right clicking a model element in the GME modeling window
+ GME_EMBEDDED_START = 3, // Not used by GME
+ GME_MENU_START = 16, // Clicking on the toolbar icon, or using the main menu
+ GME_BGCONTEXT_START = 18, // Using the context menu by right clicking the background of the GME modeling window
+ GME_ICON_START = 32, // Not used by GME
+ GME_SILENT_MODE = 128 // Not used by GME, available to testers not using GME
+ }
+
+ /// <summary>
+ /// This function is called for each interpreter invocation before Main.
+ /// Don't perform MGA operations here unless you open a tansaction.
+ /// Typically, you initialize your static variables here:
+ /// constructors/initializations for static classes and fields are executed once at loading time, not for every interpreter invocation.
+ /// </summary>
+ /// <param name="project">The handle of the project opened in GME, for which the interpreter was called.</param>
+ public void Initialize(MgaProject project)
+ {
+ // TODO: Add your initialization code here...
+ }
+
+ /// <summary>
+ /// The main entry point of the interpreter. A transaction is already open,
+ /// GMEConsole is avaliable. A general try-catch block catches all the exceptions
+ /// coming from this function, you don't need to add it. For more information, see InvokeEx.
+ /// </summary>
+ /// <param name="project">The handle of the project opened in GME, for which the interpreter was called.</param>
+ /// <param name="currentobj">The model open in the active tab in GME. Its value is null if no model is open (no GME modeling windows open). </param>
+ /// <param name="selectedobjs">
+ /// A collection for the selected model elements. It is never null.
+ /// If the interpreter is invoked by the context menu of the GME Tree Browser, then the selected items in the tree browser. Folders
+ /// are never passed (they are not FCOs).
+ /// If the interpreter is invoked by clicking on the toolbar icon or the context menu of the modeling window, then the selected items
+ /// in the active GME modeling window. If nothing is selected, the collection is empty (contains zero elements).
+ /// </param>
+ /// <param name="startMode">Contains information about the GUI event that initiated the invocation.</param>
+ public void Main(MgaProject project, MgaFCO currentobj, MgaFCOs selectedobjs, ComponentStartMode startMode)
+ {
+ // TODO: Add your interpreter code
+ GMEConsole.Out.WriteLine("Running interpreter...");
+
+ // Get RootFolder
+ $GET_ROOTFOLDER_CODE$
+
+ }
+
+ #region IMgaComponentEx Members
+
+ public void InvokeEx(MgaProject project, MgaFCO currentobj, MgaFCOs selectedobjs, int param)
+ {
+ if (!enabled)
+ {
+ return;
+ }
+
+ try
+ {
+ MgaGateway.territory = null;
+ try
+ {
+ // Initializing console
+ GMEConsole.gme = (IGMEOLEApp)project.GetClientByName("GME.Application").OLEServer;
+ }
+ catch (COMException ex)
+ {
+ // if GME is not present, the interpreter is called from standalone test application
+ if (ex.ErrorCode != -2023423888) // HResult 0x87650070: "Search by name failed"
+ {
+ throw;
+ }
+ GMEConsole.gme = null;
+ }
+ MgaGateway.project = project;
+ project.CreateTerritoryWithoutSink(out MgaGateway.territory);
+
+ MgaGateway.BeginTransaction(); // Remove this line for custom transactions, change if read-only interpretation
+ Main(project, currentobj, selectedobjs, Convert(param));
+ MgaGateway.CommitTransaction(); // Remove this line for custom transactions
+ }
+ catch (Exception ex)
+ {
+ GMEConsole.Error.WriteLine(ex.Message);
+ // Remove this line for custom transactions.
+ // Be careful: if a transaction is left open, GME is in inconsistent state
+ if (MgaGateway.territory != null)
+ {
+ MgaGateway.AbortTransaction();
+ }
+ }
+ finally
+ {
+ if (MgaGateway.territory != null)
+ {
+ MgaGateway.territory.Destroy();
+ }
+ MgaGateway.territory = null;
+ MgaGateway.project = null;
+ project = null;
+ currentobj = null;
+ selectedobjs = null;
+ GMEConsole.gme = null;
+ GC.Collect();
+ GC.WaitForPendingFinalizers();
+ }
+ }
+
+ private ComponentStartMode Convert(int param)
+ {
+ switch (param)
+ {
+ case (int)ComponentStartMode.GME_BGCONTEXT_START:
+ return ComponentStartMode.GME_BGCONTEXT_START;
+ case (int)ComponentStartMode.GME_BROWSER_START:
+ return ComponentStartMode.GME_BROWSER_START;
+
+ case (int)ComponentStartMode.GME_CONTEXT_START:
+ return ComponentStartMode.GME_CONTEXT_START;
+
+ case (int)ComponentStartMode.GME_EMBEDDED_START:
+ return ComponentStartMode.GME_EMBEDDED_START;
+
+ case (int)ComponentStartMode.GME_ICON_START:
+ return ComponentStartMode.GME_ICON_START;
+
+ case (int)ComponentStartMode.GME_MAIN_START:
+ return ComponentStartMode.GME_MAIN_START;
+
+ case (int)ComponentStartMode.GME_MENU_START:
+ return ComponentStartMode.GME_MENU_START;
+ case (int)ComponentStartMode.GME_SILENT_MODE:
+ return ComponentStartMode.GME_SILENT_MODE;
+ }
+
+ return ComponentStartMode.GME_SILENT_MODE;
+ }
+
+ #region Component Information
+ public string ComponentName
+ {
+ get { return GetType().Name; }
+ }
+
+ public string ComponentProgID
+ {
+ get
+ {
+ return ComponentConfig.progID;
+ }
+ }
+
+ public componenttype_enum ComponentType
+ {
+ get { return ComponentConfig.componentType; }
+ }
+ public string Paradigm
+ {
+ get { return ComponentConfig.paradigmName; }
+ }
+ #endregion
+
+ #region Enabling
+ bool enabled = true;
+ public void Enable(bool newval)
+ {
+ enabled = newval;
+ }
+ #endregion
+
+ #region Interactive Mode
+ protected bool interactiveMode = true;
+ public bool InteractiveMode
+ {
+ get
+ {
+ return interactiveMode;
+ }
+ set
+ {
+ interactiveMode = value;
+ }
+ }
+ #endregion
+
+ #region Custom Parameters
+ SortedDictionary<string, object> componentParameters = null;
+
+ public object get_ComponentParameter(string Name)
+ {
+ if (Name == "type")
+ return "csharp";
+
+ if (Name == "path")
+ return GetType().Assembly.Location;
+
+ if (Name == "fullname")
+ return GetType().FullName;
+
+ object value;
+ if(componentParameters!= null && componentParameters.TryGetValue(Name, out value))
+ {
+ return value;
+ }
+
+ return null;
+ }
+
+ public void set_ComponentParameter(string Name, object pVal)
+ {
+ if (componentParameters == null)
+ {
+ componentParameters = new SortedDictionary<string, object>();
+ }
+
+ componentParameters[Name] = pVal;
+ }
+ #endregion
+
+ #region Unused Methods
+ // Old interface, it is never called for MgaComponentEx interfaces
+ public void Invoke(MgaProject Project, MgaFCOs selectedobjs, int param)
+ {
+ throw new NotImplementedException();
+ }
+
+ // Not used by GME
+ public void ObjectsInvokeEx(MgaProject Project, MgaObject currentobj, MgaObjects selectedobjs, int param)
+ {
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #endregion
+
+ #region IMgaVersionInfo Members
+
+ public GMEInterfaceVersion_enum version
+ {
+ get { return GMEInterfaceVersion_enum.GMEInterfaceVersion_Current; }
+ }
+
+ #endregion
+
+ #region Registration Helpers
+
+ [ComRegisterFunctionAttribute]
+ public static void GMERegister(Type t)
+ {
+ Registrar.RegisterComponentsInGMERegistry();
+
+ }
+
+ [ComUnregisterFunctionAttribute]
+ public static void GMEUnRegister(Type t)
+ {
+ Registrar.UnregisterComponentsInGMERegistry();
+ }
+
+ #endregion
+
+
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/Registrar.cs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/Registrar.cs Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices;
+using MGAUtilLib;
+using MGALib;
+using GmeLib;
+using MGACoreLib;
+using Microsoft.Win32;
+
+namespace GME.CSharp
+{
+ [ComVisible(false)]
+ public class RegistrationException : ApplicationException
+ {
+ public RegistrationException(string message):base(message){}
+ }
+
+ [ComVisible(false)]
+ public class Registrar
+ {
+
+ public Registrar()
+ {
+ }
+
+
+ public static void RegisterComponentsInGMERegistry()
+ {
+ if (ComponentConfig.iconPath == null)
+ {
+ ComponentConfig.iconPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + '\\' + ComponentConfig.iconName;
+ }
+
+ try
+ {
+ MgaRegistrar registrar = new MgaRegistrar();
+ if ((int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((IGMEVersionInfo)registrar).version)
+ {
+ throw new RegistrationException("GMEInterfaceVersion mismatch: this assembly is using " +
+ (int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
+ " but the GME interface version is " + (int)((IGMEVersionInfo)registrar).version +
+ "\n\nPlease install a compatible GME version or update the interop dlls.");
+ }
+
+ registrar.RegisterComponent(ComponentConfig.progID, ComponentConfig.componentType, ComponentConfig.componentName, ComponentConfig.registrationMode);
+ registrar.set_ComponentExtraInfo(ComponentConfig.registrationMode, ComponentConfig.progID, "Icon", ComponentConfig.iconPath);
+
+ if (!ComponentConfig.paradigmName.Equals("*"))
+ {
+ registrar.Associate(
+ ComponentConfig.progID,
+ ComponentConfig.paradigmName,
+ ComponentConfig.registrationMode);
+ }
+ }
+ catch (Exception e)
+ {
+ System.Windows.Forms.MessageBox.Show(e.Message);
+ }
+
+ }
+
+
+ public static void UnregisterComponentsInGMERegistry()
+ {
+ try
+ {
+
+ MgaRegistrar registrar = new MgaRegistrar();
+ if ((int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current != (int)((IGMEVersionInfo)registrar).version)
+ {
+ throw new RegistrationException("GMEInterfaceVersion mismatch: this assembly is using " +
+ (int)GMEInterfaceVersion_enum.GMEInterfaceVersion_Current +
+ " but the GME interface version is " + (int)((IGMEVersionInfo)registrar).version +
+ "\n\nPlease install a compatible GME version or update the interop dlls.");
+ }
+
+ registrar.UnregisterComponent(ComponentConfig.progID, ComponentConfig.registrationMode);
+
+ }
+ catch (Exception e)
+ {
+ System.Windows.Forms.MessageBox.Show(e.Message);
+ }
+
+ }
+ }
+}
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/classlibrary.csproj
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/classlibrary.csproj Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>$guid1$</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>$safeprojectname$</RootNamespace>
+ <AssemblyName>$safeprojectname$</AssemblyName>
+ <TargetFrameworkVersion>v$targetframeworkversion$</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <RegisterForComInterop>true</RegisterForComInterop>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <RegisterForComInterop>true</RegisterForComInterop>
+ </PropertyGroup>
+ <!--DELETE
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>AssemblySignature.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ DELETE-->
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="Microsoft.CSharp"/>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ComponentConfig.cs" />
+ <Compile Include="MyInterpreter.cs" />
+ <Compile Include="Registrar.cs" />
+ <Compile Include="MgaGateway.cs" />
+ <Compile Include="GMEConsole.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <!--$ADDITIONALFILES$-->
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="Component.ico">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="CORELib">
+ <Guid>{9E9AAACF-28B8-11D3-B36C-0060082DF884}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="GmeLib">
+ <Guid>{0ADEEC71-D83A-11D3-B36B-005004CC8592}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="METALib">
+ <Guid>{0ADEEC71-D83A-11D3-B36B-005004D38590}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="MGALib">
+ <Guid>{270B4F86-B17C-11D3-9AD1-00AA00B6FE26}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ <COMReference Include="MGAUTILLib">
+ <Guid>{461F30AE-3BF0-11D4-B3F0-005004D38590}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
+ </ItemGroup>
+ <!--DELETE
+ <ItemGroup>
+ <None Include="AssemblySignature.snk" />
+ </ItemGroup>
+ DELETE-->
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!--
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/csClassLibrary.vstemplate
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/SDK/DotNet/CSharpComponentWizard/Templates/CSharpInterpreter/csClassLibrary.vstemplate Wed Feb 9 12:53:29 2011 (r1158)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<VSTemplate Version="3.0.0" Type="Project" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
+ <TemplateData>
+ <Name>CSharpInterpreterTemplate</Name>
+ <Description>GME CSharp Addon Template</Description>
+ <ProjectType>CSharp</ProjectType>
+ <ProjectSubType>
+ </ProjectSubType>
+ <SortOrder>20</SortOrder>
+ <CreateNewFolder>true</CreateNewFolder>
+ <DefaultName>Simple</DefaultName>
+ <ProvideDefaultName>true</ProvideDefaultName>
+ <LocationField>Enabled</LocationField>
+ <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
+ <Icon>__TemplateIcon.ico</Icon>
+ </TemplateData>
+ <TemplateContent>
+ <Project File="ClassLibrary.csproj" ReplaceParameters="true">
+ <ProjectItem ReplaceParameters="true" TargetFileName="Properties\AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">ComponentConfig.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">MyInterpreter.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">Registrar.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">MgaGateway.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">GMEConsole.cs</ProjectItem>
+ <ProjectItem ReplaceParameters="false" OpenInEditor="true">Component.ico</ProjectItem>
+ </Project>
+ </TemplateContent>
+</VSTemplate>
\ No newline at end of file
More information about the gme-commit
mailing list