示例#1
0
        static void Main()
        {
            string resource1 = "Revamped_BnS_Buddy.MetroFramework.dll";

            EmbeddedAssembly.Load(resource1, "MetroFramework.dll");
            string resource2 = "Revamped_BnS_Buddy.MetroFramework.Fonts.dll";

            EmbeddedAssembly.Load(resource2, "MetroFramework.Fonts.dll");
            string resource3 = "Revamped_BnS_Buddy.SharpCompress.dll";

            EmbeddedAssembly.Load(resource3, "SharpCompress.dll");
            string resource4 = "Revamped_BnS_Buddy.FastColoredTextBox.dll";

            EmbeddedAssembly.Load(resource4, "FastColoredTextBox.dll");
            string resource5 = "Revamped_BnS_Buddy.Ionic.Zlib.dll";

            EmbeddedAssembly.Load(resource5, "Ionic.Zlib.dll");
            string resource6 = "Revamped_BnS_Buddy.BigInteger.dll";

            EmbeddedAssembly.Load(resource6, "BigInteger.dll");

            /*string resource6 = "Revamped_BnS_Buddy.BNSDat.dll";
             * EmbeddedAssembly.Load(resource6, "BNSDat.dll");*/
            //string resource2 = "WindowsFormsApplication3.cscompmgd.dll";
            //EmbeddedAssembly.Load(resource2, "cscompmgd.dll");

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
示例#2
0
        static void Main(string[] args)
        {
            string resource1 = "RemindMe.Bunifu_UI_v1.5.3.dll";

            EmbeddedAssembly.Load(resource1, "Bunifu_UI_v1.5.3.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            using (Mutex mutex = new Mutex(false, "Global\\" + "RemindMe"))
            {
                if (!mutex.WaitOne(0, false))
                {
                    //one instance of remindme already running
                    if (args.Length > 0)
                    {//The user double-clicked an .remindme file!
                        BLIO.Log("Detected the double clicking of a .remindme file!");
                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(false);
                        Application.Run(new RemindMeImporter(args[0]));
                    }

                    return;
                }

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
                Application.Run(new Form1());
            }
        }
        internal static void Initialize()
        {
            if (!Initialized)
            {
                string basePath = "Unimake.Data.Generic.Embedded.";

                #region SQLite
                //aqui temos que extrair as dlls do SQLite
                EmbeddedAssembly.Load(basePath + "sqlite.x64.SQLite.Interop.dll", @"\x64\SQLite.Interop.dll");
                EmbeddedAssembly.Load(basePath + "sqlite.x86.SQLite.Interop.dll", @"\x86\SQLite.Interop.dll");

                EmbeddedAssembly.Load(basePath + "sqlite.SQLite.Designer.dll", @"\SQLite.Designer.dll");
                EmbeddedAssembly.Load(basePath + "sqlite.System.Data.SQLite.dll", @"\System.Data.SQLite.dll");
                EmbeddedAssembly.Load(basePath + "sqlite.System.Data.SQLite.Linq.dll", @"\System.Data.SQLite.Linq.dll");
                #endregion

                #region Npgsql
                EmbeddedAssembly.Load(basePath + "Npgsql.Npgsql.dll", @"\Npgsql.dll");
                EmbeddedAssembly.Load(basePath + "Npgsql.policy.2.0.Npgsql.config", @"\policy.2.0.Npgsql.config");
                EmbeddedAssembly.Load(basePath + "Npgsql.policy.2.0.Npgsql.dll", @"\policy.2.0.Npgsql.dll");
                EmbeddedAssembly.Load(basePath + "Npgsql.Mono.Security.dll", @"\Mono.Security.dll");
                #endregion

                Initialized = true;
            }
        }
示例#4
0
        static void Main()
        {
            /**
             * Check if the loader is already running.
             */
            bool result;
            var  mutex = new System.Threading.Mutex(true, "Intersense Client", out result);

            if (!result)
            {
                UI.MsgBox.Show("Only one instance of the loader can be running at a time.", "Only one instance", MessageBoxIcon.Error);
                return;
            }

            /**
             * Load the embedded assemblies.
             */
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
            EmbeddedAssembly.Load("tcp_moe_client.Assemblies.Newtonsoft.Json.dll", "Newtonsoft.Json.dll");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var worker = new Classes.Worker();

            Application.Run(worker.Satisfy());
        }
            public static async Task CreateTablesAndStoredProceduresAsync()
            {
                var conn = ConnectionManager.GetDefaultConnection();

                // Create a command object identifying the stored procedure
                using (var cmd = conn.CreateCommand())
                {
                    //
                    // Set the command object so it knows to execute a stored procedure
                    cmd.CommandType = CommandType.Text;

                    cmd.CommandText = EmbeddedAssembly.GetFromResources("TablesAndSPsCreatorQuery.sql");
                    //
                    // execute the command
                    try
                    {
                        await conn.OpenAsync();

                        await cmd.ExecuteNonQueryAsync();
                    }
                    finally
                    {
                        conn.Close();
                    }
                }
            }
        static void Main(string[] args)
        {
            var icon = new NotifyIcon();

            string resource1 = "ClipboardWatcher.Bunifu_UI_v1.5.3.dll";

            EmbeddedAssembly.Load(resource1, "Bunifu_UI_v1.5.3.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            using (Mutex mutex = new Mutex(false, "Global\\" + "ClipboardWatcher"))
            {
                if (!mutex.WaitOne(0, false))
                {
                    //one instance of remindme already running

                    icon.ShowBalloonTip(1000, "Balloon title", "Balloon text", ToolTipIcon.None);
                    return;
                }

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
                Application.Run(new MainForm());
            }
        }
示例#7
0
        public static void Main(string[] args)
        {
            Assembly myAssemblyList = Assembly.GetExecutingAssembly();

            string[] myResources = myAssemblyList.GetManifestResourceNames();
            foreach (string resource in myResources)
            {
                if (resource.EndsWith(".dll"))
                {
                    string[]      temp_name = resource.Split('.');
                    List <String> temp_lst  = new List <string>();
                    temp_lst = temp_name.ToList();
                    temp_lst.RemoveAt(0);
                    string filename = "";
                    foreach (string part in temp_lst)
                    {
                        filename += part + ".";
                    }
                    EmbeddedAssembly.Load(resource, filename);
                }
            }


            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);



            var app = new App();

            app.InitializeComponent();

            app.Run();
        }
示例#8
0
        static void Main()
        {
            const string resource1 = "LEDControl.CoreAudioApi.dll";
            const string resource2 = "LEDControl.Microsoft.WindowsAPICodePack.dll";
            const string resource3 = "LEDControl.CbtHook.dll";
            const string resource4 = "LEDControl.WindowsHook.dll";

            EmbeddedAssembly.Load(resource1, "CoreAudioApi.dll");
            EmbeddedAssembly.Load(resource2, "Microsoft.WindowsAPICodePack.dll");
            EmbeddedAssembly.Load(resource3, "CbtHook.dll");
            EmbeddedAssembly.Load(resource4, "WindowsHook.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if (Properties.Settings.Default.UpgradeRequired)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeRequired = false;
                Properties.Settings.Default.Save();
            }

            if ((Properties.Settings.Default.FirstRun || Control.ModifierKeys == Keys.Shift) && !Environment.GetCommandLineArgs().Contains("driver"))
            {
                Welcome w = new Welcome();
                if (w.ShowDialog() == DialogResult.Cancel)
                {
                    Environment.Exit(0);
                }
            }

            Application.Run(new Form1());
        }
示例#9
0
        static void Main()
        {
            if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1)
            {
                MessageBox.Show("Only one instance of this application is allowed.");
                Environment.Exit(-1);
            }

            // ELoad Embedded Assemblies
            string resource1 = "ProgramInstaller.Ionic.Zip.dll";

            EmbeddedAssembly.Load(resource1, "Ionic.Zip.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            string resource2 = "ProgramInstaller.Interop.IWshRuntimeLibrary.dll";

            EmbeddedAssembly.Load(resource2, "Interop.IWshRuntimeLibrary.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            form = new Form1();

            Thread t = new Thread(thread);

            t.SetApartmentState(ApartmentState.STA);
            t.Start();

            Application.Run(form);
        }
示例#10
0
        static void Main(string[] args)
        {
            string resource1 = "MousePlayback.Bunifu_UI_v1.5.3.dll";

            EmbeddedAssembly.Load(resource1, "Bunifu_UI_v1.5.3.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            using (Mutex mutex = new Mutex(false, "Global\\" + "MousePlayback"))
            {
                if (!mutex.WaitOne(0, false))
                {
                    //one instance of remindme already running
                    if (args.Length > 0)
                    {
                    }

                    return;
                }

                // Set the unhandled exception mode to force all Windows Forms errors to go through our handler.
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

                // Add the event handler for handling non-UI thread exceptions to the event.
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);


                Application.Run(new Form1());
            }
        }
示例#11
0
        public LegendasTVProvider(
            ILogger logger,
            IHttpClient httpClient,
            IServerConfigurationManager config,
            IEncryptionManager encryption,
            ILocalizationManager localizationManager,
            ILibraryManager libraryManager,
            IJsonSerializer jsonSerializer,
            IServerApplicationPaths appPaths,
            IFileSystem fileSystem,
            IZipClient zipClient)
        {
            _logger              = logger;
            _httpClient          = httpClient;
            _config              = config;
            _encryption          = encryption;
            _libraryManager      = libraryManager;
            _localizationManager = localizationManager;
            _jsonSerializer      = jsonSerializer;
            _appPaths            = appPaths;
            _fileSystem          = fileSystem;
            _zipClient           = zipClient;

            _config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;

            // Load HtmlAgilityPack from embedded resource
            EmbeddedAssembly.Load(GetType().Namespace + ".HtmlAgilityPack.dll", "HtmlAgilityPack.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler((object sender, ResolveEventArgs args) => EmbeddedAssembly.Get(args.Name));
        }
示例#12
0
        static void LoadLibrary()
        {
            var dll = "GeoRAT.Client.Libraries.GeoRAT.Core.dll";

            EmbeddedAssembly.Load(dll, "GeoRAT.Client.Libraries.GeoRAT.Core.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
        }
            public static async Task CreateDatabaseAsync()
            {
                var conn = ConnectionManager.GetDefaultConnection();

                var databaseName = conn.Connection.DatabaseName;
                var masterConn   = conn.Connection.Clone() as Connection;

                masterConn.DatabaseName = "master";

                var sqlConn = new SqlConnection(masterConn.ConnectionString);

                // Create a command object identifying the stored procedure
                using (var cmd = sqlConn.CreateCommand())
                {
                    //
                    // Set the command object so it knows to execute a stored procedure
                    cmd.CommandType = CommandType.Text;

                    cmd.CommandText =
                        EmbeddedAssembly.GetFromResources("DatabaseCreatorQuery.sql")
                        .Replace("#DatabaseName", databaseName);
                    //
                    // execute the command
                    try
                    {
                        await sqlConn.OpenAsync();

                        await cmd.ExecuteNonQueryAsync();
                    }
                    finally
                    {
                        sqlConn.Close();
                    }
                }
            }
示例#14
0
        public static void libStart()
        {
            string kaynak1 = "SYuksel.libs.HtmlAgilityPack.dll";

            EmbeddedAssembly.Load(kaynak1, "HtmlAgilityPack.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
        }
示例#15
0
        /// <summary>
        /// Inicializa API
        /// </summary>
        public static void InitializeApi()
        {
            var assembly = Assembly.GetExecutingAssembly();

            string[] resourceList = assembly.GetManifestResourceNames();

            foreach (string resource in resourceList)
            {
                if (resource.Contains(Constant.SQLiteDll))
                {
                    EmbeddedAssembly.Load(resource, Constant.SQLiteDll);
                    AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
                }
                else if (resource.Contains(Constant.SFLogDll))
                {
                    EmbeddedAssembly.Load(resource, Constant.SFLogDll);
                    AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
                }
                else
                {
                    string fileName = string.Empty;
                    Stream stream   = assembly.GetManifestResourceStream(resource);

                    if (resource.Contains(Constant.SQLiteInteropDllGzX64))
                    {
                        string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Constant.x64);

                        if (!Directory.Exists(filePath))
                        {
                            Directory.CreateDirectory(filePath);
                        }

                        fileName = Path.Combine(filePath, Constant.SQLiteInteropDllGzX64);
                    }
                    else if (resource.Contains(Constant.SQLiteInteropDllGzX86))
                    {
                        string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Constant.x86);

                        if (!Directory.Exists(filePath))
                        {
                            Directory.CreateDirectory(filePath);
                        }

                        fileName = Path.Combine(filePath, Constant.SQLiteInteropDllGzX86);
                    }

                    if (!File.Exists(fileName))
                    {
                        using (Stream file = File.Create(fileName))
                        {
                            Utility.CopyStream(stream, file);
                        }

                        Utility.DecompressGZip(fileName, Constant.SQLiteInteropDll);
                        File.Delete(fileName);
                    }
                }
            }
        }
示例#16
0
 private static void SetupEmbeddedAssemblies()
 {
     EmbeddedAssembly.Load("Ionic.Zip.dll");
     AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs args)
     {
         return(EmbeddedAssembly.Get(args.Name));
     };
 }
示例#17
0
 static void Main()
 {
     using (var ass = new EmbeddedAssembly())
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         Application.Run(new ConnectDialog());
     }
 }
示例#18
0
        static void Main()
        {
            EmbeddedAssembly.Load("MacetimTools.System.Data.SQLite.dll", "System.Data.SQLite.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
示例#19
0
        public MainWindow()
        {
            EmbeddedAssembly.Load("create_sfx.Resources.SevenZipSharp.dll", "SevenZipSharp.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            InitializeComponent();

            files = new List <string>();
        }
        public LuceneService()
        {
            EmbeddedAssembly.Load(resource1, "Lucene.Net.dll");
            EmbeddedAssembly.Load(resource2, "ICSharpCode.SharpZipLib.dll");

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            InitialiseLucene();
        }
示例#21
0
文件: Program.cs 项目: faruk28/Zekat
        static void Main()
        {
            EmbeddedAssembly.Load("Zekat.HtmlAgilityPack.dll", "HtmlAgilityPack.dll");
            EmbeddedAssembly.Load("Zekat.Newtonsoft.Json.dll", "Newtonsoft.Json.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Zekat());
        }
示例#22
0
        private static void Main()
        {
            EmbeddedAssembly.Load("K_Relay.MetroFramework.dll", "K_Relay.MetroFramework.dll");
            EmbeddedAssembly.Load("K_Relay.MetroFramework.Design.dll", "K_Relay.MetroFramework.Design.dll");
            EmbeddedAssembly.Load("K_Relay.MetroFramework.Fonts.dll", "K_Relay.MetroFramework.Fonts.dll");

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            DoAppSetup();
        }
        public void AddAssembly(byte[] rawAssembly, bool encrypt = true, bool compress = true)
        {
            var embeddedAssembly = new EmbeddedAssembly();

            var assemblyRef = AssemblyReference.GetAssemblyName(PEImage.Load(rawAssembly, null));

            embeddedAssembly.Name   = assemblyRef.Name;
            embeddedAssembly.DataID = _storage.Add(rawAssembly, encrypt, compress);
            _assemblies.Add(embeddedAssembly);
        }
示例#24
0
        static void Main()
        {
            EmbeddedAssembly.Load("Unturned_Uconomy_Utility.libs.MySql.Data.dll", "MySql.Data.dll");

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            new frmWelcome().Show();
            Application.Run(new frmMain());
        }
示例#25
0
        static void Main()
        {
            var dll = "GeoRAT.Server.Libraries.GeoRAT.Core.dll";

            EmbeddedAssembly.Load(dll, "GeoRAT.Server.Libraries.GeoRAT.Core.dll");
            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
示例#26
0
        static void Main()
        {
            string resPrefix = "IEDExplorer.Embed.";
            string filename1 = "iec61850dotnet.dll";
            string filename2 = "iec61850.dll";
            string filename3 = "PcapDotNet.Base.dll";
            string filename4 = "PcapDotNet.Core.dll";
            string filename5 = "PcapDotNet.Core.Extensions.dll";
            string filename6 = "PcapDotNet.Packets.dll";

            EmbeddedAssembly.Load(resPrefix + filename1, filename1);
            EmbeddedAssembly.Load(resPrefix + filename2, filename2);
            EmbeddedAssembly.Load(resPrefix + filename3, filename3);
            EmbeddedAssembly.Load(resPrefix + filename4, filename4);
            EmbeddedAssembly.Load(resPrefix + filename5, filename5);
            EmbeddedAssembly.Load(resPrefix + filename6, filename6);

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Env env = new Env();

            Application.Run(new Views.MainWindow());

            List <string> natives = new List <string>();

            natives.Add(filename2);
            //natives.Add(filename4);

            foreach (string filename in natives)
            {
                string path2 = null;
                try
                {
                    path2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filename);
                    if (File.Exists(path2))
                    {
                        File.Delete(path2);
                    }
                }
                catch
                {
                    try
                    {
                        //AppDomain.CurrentDomain.DomainManager. //.Unload(AppDomain.CurrentDomain);
                        UnloadImportedDll(path2);
                        Thread.Sleep(100);
                        File.Delete(path2);
                    }
                    catch { }
                }
            }
        }
示例#27
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            EmbeddedAssembly.Load("ATCScript.CSScriptLibrary.dll", "CSScriptLibrary.dll");
            EmbeddedAssembly.Load("ATCScript.ICSharpCode.TextEditor.dll", "ICSharpCode.TextEditor.dll");

            Application.Run(new Form1());
        }
示例#28
0
        static void Main()
        {
            EmbeddedAssembly.Load("Spro.EPPlus.dll", "EPPlus.dll");
            EmbeddedAssembly.Load("Spro.System.Data.SqlLocalDb.dll", "System.Data.SqlLocalDb.dll");

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new ParkingManageMenu());
        }
示例#29
0
        static void Main()
        {
            EmbeddedAssembly.Load("Base64.Lzma#.dll", "Lzma#.dll");


            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
示例#30
0
 private static void Main()
 {
     EmbeddedAssembly.Load("Nico3D模型获取工具.Newtonsoft.Json.dll", "Newtonsoft.Json.dll");
     EmbeddedAssembly.Load("Nico3D模型获取工具.PEPlugin.dll", "PEPlugin.dll");
     EmbeddedAssembly.Load("Nico3D模型获取工具.PMDEditorLib.dll", "PMDEditorLib.dll");
     EmbeddedAssembly.Load("Nico3D模型获取工具.SlimDX.dll", "SlimDX.dll");
     AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new OpenForm());
 }