CodeViewAndExec

This commit is contained in:
Melons 2020-05-04 14:59:31 +01:00
commit 8467496f5e
68 changed files with 1380 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.vs/
CodeViewAndExec/bin/Debug/
CodeViewAndExec/bin/Release/
CodeViewModdingApi/bin/Debug/
CodeViewModdingApi/bin/Release/

31
CodeViewAndExec.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.902
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeViewAndExec", "CodeViewAndExec\CodeViewAndExec.csproj", "{182D9313-F4C3-45DF-AEAA-F8049F620D8F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeViewModdingApi", "CodeViewModdingApi\CodeViewModdingApi.csproj", "{E86481C3-2631-4947-8E80-5C45F5426D53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{182D9313-F4C3-45DF-AEAA-F8049F620D8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{182D9313-F4C3-45DF-AEAA-F8049F620D8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{182D9313-F4C3-45DF-AEAA-F8049F620D8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{182D9313-F4C3-45DF-AEAA-F8049F620D8F}.Release|Any CPU.Build.0 = Release|Any CPU
{E86481C3-2631-4947-8E80-5C45F5426D53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E86481C3-2631-4947-8E80-5C45F5426D53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E86481C3-2631-4947-8E80-5C45F5426D53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E86481C3-2631-4947-8E80-5C45F5426D53}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {376C3571-2BD4-44A6-9FBC-C01A07434158}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{182D9313-F4C3-45DF-AEAA-F8049F620D8F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>CodeViewAndExec</RootNamespace>
<AssemblyName>CodeViewAndExec</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CodeViewer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CodeViewer.Designer.cs">
<DependentUpon>CodeViewer.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="ModLoader.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RunPythonCode.cs" />
<Compile Include="ScriptDownloader.cs" />
<EmbeddedResource Include="CodeViewer.resx">
<DependentUpon>CodeViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CodeViewModdingApi\CodeViewModdingApi.csproj">
<Project>{e86481c3-2631-4947-8e80-5c45f5426d53}</Project>
<Name>CodeViewModdingApi</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

88
CodeViewAndExec/CodeViewer.Designer.cs generated Normal file
View File

@ -0,0 +1,88 @@
namespace CodeViewAndExec
{
partial class CodeViewer
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 41);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(776, 397);
this.textBox1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(133, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Script Name: <not loaded>";
//
// button1
//
this.button1.Location = new System.Drawing.Point(713, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Run";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// CodeViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CodeViewer";
this.Text = "CodeViewer";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
}
}

View File

@ -0,0 +1,28 @@
using System.Windows.Forms;
using System.IO;
namespace CodeViewAndExec
{
public partial class CodeViewer : Form
{
public CodeViewer()
{
InitializeComponent();
}
private string FilePath="";
public void SetFilePath(string f)
{
FilePath = f;
label1.Text = "Script Name: "+new FileInfo(f).Name;
string FileText = File.ReadAllText(f);
textBox1.Text = FileText.Replace("\r", string.Empty).Replace("\n","\r\n");
}
private void button1_Click(object sender, System.EventArgs e)
{
RunPythonCode.FromFile(FilePath);
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

100
CodeViewAndExec/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,100 @@
namespace CodeViewAndExec
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.ListOfScripts = new System.Windows.Forms.ListBox();
this.ViewCodeButton = new System.Windows.Forms.Button();
this.RunCodeButton = new System.Windows.Forms.Button();
this.FileDownloadProgress = new System.Windows.Forms.ProgressBar();
this.SuspendLayout();
//
// ListOfScripts
//
this.ListOfScripts.FormattingEnabled = true;
this.ListOfScripts.Location = new System.Drawing.Point(13, 13);
this.ListOfScripts.Name = "ListOfScripts";
this.ListOfScripts.Size = new System.Drawing.Size(316, 199);
this.ListOfScripts.TabIndex = 0;
//
// ViewCodeButton
//
this.ViewCodeButton.Location = new System.Drawing.Point(12, 218);
this.ViewCodeButton.Name = "ViewCodeButton";
this.ViewCodeButton.Size = new System.Drawing.Size(155, 38);
this.ViewCodeButton.TabIndex = 1;
this.ViewCodeButton.Text = "View Code";
this.ViewCodeButton.UseVisualStyleBackColor = true;
this.ViewCodeButton.Click += new System.EventHandler(this.ViewCodeButton_Click);
//
// RunCodeButton
//
this.RunCodeButton.Location = new System.Drawing.Point(174, 218);
this.RunCodeButton.Name = "RunCodeButton";
this.RunCodeButton.Size = new System.Drawing.Size(155, 38);
this.RunCodeButton.TabIndex = 2;
this.RunCodeButton.Text = "Run Code";
this.RunCodeButton.UseVisualStyleBackColor = true;
this.RunCodeButton.Click += new System.EventHandler(this.RunCodeButton_Click);
//
// FileDownloadProgress
//
this.FileDownloadProgress.Location = new System.Drawing.Point(13, 13);
this.FileDownloadProgress.Name = "FileDownloadProgress";
this.FileDownloadProgress.Size = new System.Drawing.Size(316, 199);
this.FileDownloadProgress.TabIndex = 3;
this.FileDownloadProgress.Visible = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(340, 268);
this.Controls.Add(this.FileDownloadProgress);
this.Controls.Add(this.RunCodeButton);
this.Controls.Add(this.ViewCodeButton);
this.Controls.Add(this.ListOfScripts);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.Text = "Code View and Exec Gui";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.ListBox ListOfScripts;
private System.Windows.Forms.Button ViewCodeButton;
private System.Windows.Forms.Button RunCodeButton;
private System.Windows.Forms.ProgressBar FileDownloadProgress;
}
}

102
CodeViewAndExec/Form1.cs Normal file
View File

@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using CodeViewModdingApi;
namespace CodeViewAndExec
{
public partial class Form1 : Form
{
public static string AppdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
public static string CodeViewAndExecData = Path.Combine(AppdataFolder, "CodeViewAndExec");
public static string ModsFolder = Path.Combine(CodeViewAndExecData, "mods");
public static void CheckDirectory(string dir)
{
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
}
public List<ScriptBlob> ScriptList;
public Form1()
{
InitializeComponent();
ScriptList = new List<ScriptBlob>();
}
public ModLoader Loader;
private void RunCodeButton_Click(object sender, EventArgs e)
{
Debug.WriteLine("Run Code Button Pressed");
ScriptDownloader d = new ScriptDownloader();
d.DownloadProgress += DownloadProgress;
d.DownloadComplete += DownloadCompleteRunCode;
ScriptBlob SelectedScriptItem = (ScriptBlob)ListOfScripts.SelectedItem;
d.Download(SelectedScriptItem.ScriptUrl);
FileDownloadProgress.Value = 0;
FileDownloadProgress.Visible = true;
}
private void ViewCodeButton_Click(object sender, EventArgs e)
{
Debug.WriteLine("Open Code Button Pressed");
ScriptDownloader d = new ScriptDownloader();
d.DownloadProgress += DownloadProgress;
d.DownloadComplete += DownloadCompleteOpenFile;
ScriptBlob SelectedScriptItem = (ScriptBlob)ListOfScripts.SelectedItem;
d.Download(SelectedScriptItem.ScriptUrl);
FileDownloadProgress.Value = 0;
FileDownloadProgress.Visible = true;
}
public void DownloadProgress(int progress)
{
FileDownloadProgress.Value = progress;
}
public void DownloadCompleteOpenFile(string FilePath)
{
FileDownloadProgress.Visible = false;
CodeViewer codeviewer = new CodeViewer();
codeviewer.SetFilePath(FilePath);
codeviewer.Owner = this;
codeviewer.ShowDialog();
}
public void DownloadCompleteRunCode(string FilePath)
{
FileDownloadProgress.Visible = false;
RunPythonCode.FromFile(FilePath);
}
private void Form1_Load(object sender, EventArgs e)
{
CheckDirectory(AppdataFolder);
CheckDirectory(CodeViewAndExecData);
CheckDirectory(ModsFolder);
Loader = new ModLoader();
Loader.ScriptAdded += ModScriptAdded;
Loader.LoadModsFromFolder(ModsFolder);
Loader.ActivateMods();
Loader.LoadMods(new EventArgs());
}
private void ModScriptAdded(object sender, ScriptBlob s)
{
ScriptList.Add(s);
AddToListBox(s);
}
private void AddToListBox(ScriptBlob s)
{
ListOfScripts.Items.Add(s);
ListOfScripts.SelectedIndex = 0;
}
}
}

120
CodeViewAndExec/Form1.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,130 @@
using System;
using System.Reflection;
using System.Collections.Generic;
using System.IO;
using CodeViewModdingApi;
namespace CodeViewAndExec
{
public class ModLoader
{
private List<LoadedMod> modlist;
public class ModLoadEventArgs
{
public string ModName = "";
public ModLoadEventArgs(string a)
{
ModName = a;
}
}
public delegate void ScriptAddedEventHandler(object sender, ScriptBlob s);
public event ScriptAddedEventHandler ScriptAdded;
public ModLoader()
{
modlist = new List<LoadedMod>();
Console.WriteLine("Starting mod loader");
}
public void LoadModsFromFolder(string modpath)
{
DirectoryInfo moddir = new DirectoryInfo(modpath);
foreach (FileInfo fileobj in moddir.GetFiles("*.dll"))
{
Assembly DLL = Assembly.LoadFile(Path.Combine(moddir.FullName, fileobj.Name));
foreach (Type type in DLL.GetExportedTypes())
{
dynamic c = Activator.CreateInstance(type);
try
{
if (c.CodeViewAndExecMod != true)
{
Console.WriteLine("Stopped loading invalid dll: " + fileobj.Name);
continue;
}
}
catch (InvalidOperationException)
{
Console.WriteLine("Stopped loading invalid dll: " + fileobj.Name);
continue;
}
catch (TargetInvocationException)
{
Console.WriteLine("Stopped loading invalid dll: " + fileobj.Name);
continue;
}
LoadedMod modinfo = new LoadedMod(c, this);
modlist.Add(modinfo);
Console.WriteLine("Started mod: " + modinfo.ModName);
}
}
}
public void ActivateMods()
{
Console.WriteLine("Activating mods");
foreach (LoadedMod mod in modlist)
{
Console.WriteLine("Starting " + mod.ModName);
mod.Activate();
}
}
public void LoadMods(EventArgs e)
{
Console.WriteLine("Loading mods");
foreach (LoadedMod mod in modlist)
{
Console.WriteLine("Loading " + mod.ModName);
mod.Api.OnLoad(e);
}
}
public LoadedMod GetMod(string name)
{
foreach (LoadedMod mod in modlist)
{
if (mod.ModName == name) return mod;
}
return null;
}
public void OnScriptAdded(ScriptBlob s)
{
ScriptAdded?.Invoke(this, s);
}
}
public class LoadedMod
{
public string ModName = "";
public string ModType = "";
private dynamic Inst;
public bool Loaded = false;
public bool Unloaded = false;
public ModdingApi Api = new ModdingApi();
private ModLoader ModLoader;
public LoadedMod(dynamic mod, ModLoader b)
{
ModName = mod.ModName;
ModType = mod.ModType;
Inst = mod;
ModLoader = b;
Api.AddScriptEvent += ScriptAdded;
}
private void ScriptAdded(object sender, ScriptBlob s)
{
Console.WriteLine("Script added: " + ModName);
ModLoader.OnScriptAdded(s);
}
public void Activate()
{
Console.WriteLine("Activating " + ModName);
Inst.Activate(Api);
}
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CodeViewAndExec
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -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("CodeViewAndExec")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CodeViewAndExec")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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("182d9313-f4c3-45df-aeaa-f8049f620d8f")]
// 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")]

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CodeViewAndExec.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CodeViewAndExec.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CodeViewAndExec.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -0,0 +1,35 @@
using System;
using System.Diagnostics;
using System.IO;
namespace CodeViewAndExec
{
class RunPythonCode
{
public static string AppdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
public static string CodeViewAndExecData = Path.Combine(AppdataFolder, "CodeViewAndExec");
public static string RunPythonFileCodePath = Path.Combine(CodeViewAndExecData, "runpythoncode.bat");
public static void CheckDirectory(string dir)
{
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
}
public static void FromFile(string f)
{
CheckDirectory(AppdataFolder);
CheckDirectory(CodeViewAndExecData);
File.WriteAllText(RunPythonFileCodePath, "@ECHO OFF\npython \""+f+"\"\npause");
ProcessStartInfo start = new ProcessStartInfo
{
FileName = "cmd",
Arguments = string.Format("/c {0}", RunPythonFileCodePath),
UseShellExecute = true
};
Process p = Process.Start(start);
}
}
}

View File

@ -0,0 +1,62 @@
using System;
using System.IO;
using System.Net;
using System.ComponentModel;
namespace CodeViewAndExec
{
public class ScriptDownloader
{
public static string AppdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
public static string CodeViewAndExecData = Path.Combine(AppdataFolder, "CodeViewAndExec");
public static string ScriptStorage = Path.Combine(CodeViewAndExecData, "ScriptStorage");
public delegate void DownloadProgressEventHandler(int ProgressPercentage);
public event DownloadProgressEventHandler DownloadProgress;
public delegate void DownloadCompleteEventHandler(string FilePath);
public event DownloadCompleteEventHandler DownloadComplete;
public static void CheckDirectory(string dir)
{
if(!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
}
public string FilePath = "";
public void Download(string remoteUri)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
FilePath = Path.Combine(ScriptStorage, Path.GetFileName(remoteUri));
using (WebClient client = new WebClient())
{
try
{
CheckDirectory(AppdataFolder);
CheckDirectory(CodeViewAndExecData);
CheckDirectory(ScriptStorage);
Uri uri = new Uri(remoteUri);
client.DownloadFileCompleted += new AsyncCompletedEventHandler(Extract);
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgessChanged);
client.DownloadFileAsync(uri, FilePath);
}
catch (Exception)
{
throw;
}
}
}
public void Extract(object sender, AsyncCompletedEventArgs e)
{
Console.WriteLine("File has been downloaded.");
DownloadComplete?.Invoke(FilePath);
}
public void ProgessChanged(object sender, DownloadProgressChangedEventArgs e)
{
Console.WriteLine($"Download status: {e.ProgressPercentage}%.");
DownloadProgress?.Invoke(e.ProgressPercentage);
}
}
}

View File

@ -0,0 +1 @@
41b7151885c0c48eb3ee82c3da4eada092517f74

View File

@ -0,0 +1,14 @@
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Debug\CodeViewAndExec.exe.config
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Debug\CodeViewAndExec.exe
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Debug\CodeViewAndExec.pdb
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Debug\CodeViewModdingApi.dll
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Debug\CodeViewModdingApi.pdb
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.csprojAssemblyReference.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.Form1.resources
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.Properties.Resources.resources
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.csproj.GenerateResource.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.csproj.CoreCompileInputs.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.csproj.CopyComplete
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.exe
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.pdb
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Debug\CodeViewAndExec.CodeViewer.resources

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
5f0ece89ddb54c4e5a20d86f1e41109e3f655ad8

View File

@ -0,0 +1,14 @@
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Release\CodeViewAndExec.exe.config
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Release\CodeViewAndExec.exe
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Release\CodeViewAndExec.pdb
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Release\CodeViewModdingApi.dll
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\bin\Release\CodeViewModdingApi.pdb
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.csprojAssemblyReference.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.CodeViewer.resources
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.Form1.resources
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.Properties.Resources.resources
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.csproj.GenerateResource.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.csproj.CoreCompileInputs.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.csproj.CopyComplete
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.exe
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewAndExec\obj\Release\CodeViewAndExec.pdb

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E86481C3-2631-4947-8E80-5C45F5426D53}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CodeViewModdingApi</RootNamespace>
<AssemblyName>CodeViewModdingApi</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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>
</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>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ModdingApi.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,43 @@
using System;
namespace CodeViewModdingApi
{
public class ModdingApi
{
public ModdingApi()
{
}
public delegate void OnAddScriptEventHandler(Object sender, ScriptBlob s);
public event OnAddScriptEventHandler AddScriptEvent;
public event EventHandler Load;
public virtual void OnLoad(EventArgs e)
{
Load?.Invoke(this, e);
}
public void AddScript(ScriptBlob s)
{
AddScriptEvent?.Invoke(this, s);
}
}
public class ScriptBlob
{
public string ScriptName = "";
public string ScriptUrl = "";
public ScriptBlob(string Name, string Url)
{
ScriptName = Name;
ScriptUrl = Url;
}
public override string ToString()
{
return ScriptName;
}
}
}

View File

@ -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("CodeViewModdingApi")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CodeViewModdingApi")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[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("e86481c3-2631-4947-8e80-5c45f5426d53")]
// 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")]

View File

@ -0,0 +1 @@
f80defa57127b5bade1f2eb8d015987475f5ebd7

View File

@ -0,0 +1,6 @@
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\bin\Debug\CodeViewModdingApi.dll
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\bin\Debug\CodeViewModdingApi.pdb
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\obj\Debug\CodeViewModdingApi.csprojAssemblyReference.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\obj\Debug\CodeViewModdingApi.csproj.CoreCompileInputs.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\obj\Debug\CodeViewModdingApi.dll
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\obj\Debug\CodeViewModdingApi.pdb

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
f80defa57127b5bade1f2eb8d015987475f5ebd7

View File

@ -0,0 +1,5 @@
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\bin\Release\CodeViewModdingApi.dll
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\bin\Release\CodeViewModdingApi.pdb
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\obj\Release\CodeViewModdingApi.csproj.CoreCompileInputs.cache
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\obj\Release\CodeViewModdingApi.dll
C:\Users\Sean\source\repos\CodeViewAndExec\CodeViewModdingApi\obj\Release\CodeViewModdingApi.pdb

Binary file not shown.

Binary file not shown.