Exemplo n.º 1
0
 static void InitializeGlobals(MainForm mainFrm)
 {
     Globals.PluginAggregator = new Plugin.PluginAggregator();
     Globals.ServerPool = new ServerPool();
     Globals.MainForm = mainFrm;
     Globals.PacketProcessor = new StandardPacketProcessor()
     {
         PacketTable = new Dictionary<int,Type>
         {
             {-1, typeof(FetchPluginMetadataPacket)},
             {-2, typeof(PluginActionPacket)},
             {-3, typeof(SynchronizationFinalizationPacket)}
         }
     };
     Globals.SettingsHelper = new Tools.SettingsHelper();
     Globals.RemotePluginHandler = new Plugin.RemotePluginHandler();
     if (!File.Exists("settings.xml"))
     {
         Globals.PluginAggregator.LoadPlugins();
         Globals.SettingsHelper.CreateSettingsFile();
         var pluginMngrFrm = new PluginManagerForm();
         pluginMngrFrm.ShowDialog();
     }
     Globals.PluginAggregator.FetchPlugins();
 }
Exemplo n.º 2
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     var mainFrm = new MainForm();
     InitializeGlobals(mainFrm);
     Application.Run(mainFrm);
 }