示例#1
0
        static Main()
        {
            string pluginPath      = typeof(Main).Assembly.Location;
            string pluginName      = Path.GetFileNameWithoutExtension(pluginPath);
            string pluginSubFolder = Path.Combine(Path.GetDirectoryName(pluginPath), pluginName);

            AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs args) =>
            {
                string assemblyPath = Path.Combine(pluginSubFolder, new AssemblyName(args.Name).Name + ".dll");
                if (File.Exists(assemblyPath))
                {
                    return(Assembly.LoadFrom(assemblyPath));
                }
                else
                {
                    return(null);
                }
            };
            nps       = new NppSettings();
            npc       = new NppCommands(nps);
            npe       = new NppEvents(nps, npc);
            fc        = new FormatCommands(nps, npc);
            FileCache = new Dictionary <IntPtr, BufferInfo>();
        }
示例#2
0
 internal NppEvents(NppSettings s, NppCommands c)
 {
     nps = s;
     npc = c;
 }
示例#3
0
 internal FormatCommands(NppSettings s, NppCommands c)
 {
     nps = s;
     npc = c;
 }