References
Posted: 29 Mar 2014, 19:06
I think a cool feature to add would be to have the ability to add links to .dlls in your code as comments in the first lines, and when it was compiled, mcdzienny would add the references to those .dlls.
Something like this:
And an example command with custom references:
Something like this:
- Code: Select all
using System;
using System.IO;
using System.Reflection;
using System.Collections.Generic;
public List<AssemblyName> GetReferences(string csfile)
{
List<AssemblyName> returnarray = new List<AssemblyName>();
string[] lines = File.ReadAllLines(csfile);
for(int x = 0; x < lines.Length; x++) {
if(!lines[x].StartsWith("//")) {
break;
}
string file = lines[x].Substring(2);
if(File.Exists(file)) {
returnarray.Add(Assembly.LoadFile(file).GetName());
}
}
return returnarray;
}
And an example command with custom references:
- Code: Select all
//C:\Users\Tom\Desktop\Connor\Minecraft_Server\Classic\MCDzienny\IRCLibrary.dll
using System;
using IRCLibrary;
namespace MCDzienny
{
public class CmdExample : Command
{
}
}