Inheritance: IMessageCallback
Exemplo n.º 1
0
        public bool SignalExternalCommandLineArgs(IList <string> args)
        {
            MainWindow.WindowState = WindowState.Normal;
            MainWindow.Activate();

            string filename;

            if (args != null && args.Count == 2)
            {
                if (System.IO.File.Exists(System.IO.Path.GetFullPath(args[1])))
                {
                    filename = System.IO.Path.GetFileName(System.IO.Path.GetFullPath(args[1]));


                    if (filename.EndsWith("osapp", StringComparison.Ordinal))
                    {
                        // its a plugin package
                        PluginInstallerHelper pInst = new PluginInstallerHelper();
                        pInst.InstallPlugin(System.IO.Path.GetFullPath(args[1]));
                    }
                }
            }

            return(true);
        }
Exemplo n.º 2
0
        public bool SignalExternalCommandLineArgs(IList<string> args)
        {
            MainWindow.WindowState = WindowState.Normal;
            MainWindow.Activate();

            string filename;

            if (args != null && args.Count == 2)
            {
                if (System.IO.File.Exists(System.IO.Path.GetFullPath(args[1])))
                {
                    filename = System.IO.Path.GetFileName(System.IO.Path.GetFullPath(args[1]));


                    if (filename.EndsWith("osapp", StringComparison.Ordinal))
                    {
                        // its a plugin package
                        PluginInstallerHelper pInst = new PluginInstallerHelper();
                        pInst.InstallPlugin(System.IO.Path.GetFullPath(args[1]));
                    }
                }
            }

            return true;
        }
        public static void Main(string[] args)
        {
            if (SingleInstance<App>.InitializeAsFirstInstance(Unique))
            {
                string filename;

                if (args != null && args.Length == 1)
                {
                    if (System.IO.File.Exists(System.IO.Path.GetFullPath(args[0])))
                    {
                        filename = System.IO.Path.GetFileName(System.IO.Path.GetFullPath(args[0]));

                        if (filename.EndsWith("osapp", StringComparison.Ordinal))
                        {
                            // its a plugin package
                            PluginInstallerHelper pInst = new PluginInstallerHelper();
                            pInst.InstallPlugin(System.IO.Path.GetFullPath(args[0]));
                        }
                    }
                }
                else
                {
                    var application = new App();

                    application.InitializeComponent();
                    application.Run();
                }

                // Allow single instance code to perform cleanup operations
                SingleInstance<App>.Cleanup();
            }
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            if (SingleInstance <App> .InitializeAsFirstInstance(Unique))
            {
                string filename;

                if (args != null && args.Length == 1)
                {
                    if (System.IO.File.Exists(System.IO.Path.GetFullPath(args[0])))
                    {
                        filename = System.IO.Path.GetFileName(System.IO.Path.GetFullPath(args[0]));

                        if (filename.EndsWith("osapp", StringComparison.Ordinal))
                        {
                            // its a plugin package
                            PluginInstallerHelper pInst = new PluginInstallerHelper();
                            pInst.InstallPlugin(System.IO.Path.GetFullPath(args[0]));
                        }
                    }
                }
                else
                {
                    var application = new App();

                    application.InitializeComponent();
                    application.Run();
                }

                // Allow single instance code to perform cleanup operations
                SingleInstance <App> .Cleanup();
            }
        }
Exemplo n.º 5
0
        private void InstallWebPlugin()
        {
            using (WebClient wc = new WebClient())
            {
                wc.DownloadFile("http://opensourceautomation.com/dl.php?plugin_id=e733a7e3-25e3-40be-b976-f8fba026fd2b&plugin_version=0.4.7&plugin_state=beta", @".\temp.osapp");
            }
            PluginInstallerHelper pInst = new PluginInstallerHelper();

            pInst.InstallPlugin(".\\temp.osapp");
        }
        private void InstallPlugin_Click(object sender, RoutedEventArgs e)
        {
            // Configure open file dialog box
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.FileName   = "";                                                       // Default file name
            dlg.DefaultExt = ".osapp";                                                 // Default file extension
            dlg.Filter     = "Open Source Automation Plugin Pakages (.osapp)|*.osapp"; // Filter files by extension

            // Show open file dialog box
            Nullable <bool> result = dlg.ShowDialog();

            // Process open file dialog box results
            if (result == true)
            {
                // Open Plugin Package
                PluginInstallerHelper.InstallPlugin(dlg.FileName);
                loadPlugins();
            }
        }
        private void InstallPlugin_Click(object sender, RoutedEventArgs e)
        {
            // Configure open file dialog box
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.FileName = string.Empty; // Default file name
            dlg.DefaultExt = ".osapp"; // Default file extension
            dlg.Filter = "Open Source Automation Plugin Pakages (.osapp)|*.osapp"; // Filter files by extension

            // Show open file dialog box
            Nullable<bool> result = dlg.ShowDialog();

            // Process open file dialog box results
            if (result == true)
            {
                this.Log.Info("Plugin file selected: " + dlg.FileName + ".  Installing...");
                // Open Plugin Package
                PluginInstallerHelper pInst = new PluginInstallerHelper();
                pInst.InstallPlugin(dlg.FileName);
                loadPlugins();
            }
        }
 private void InstallWebPlugin()
 {
     using (WebClient wc = new WebClient())
     {
         wc.DownloadFile("http://opensourceautomation.com/dl.php?plugin_id=e733a7e3-25e3-40be-b976-f8fba026fd2b&plugin_version=0.4.7&plugin_state=beta", @".\temp.osapp");
     }
     PluginInstallerHelper pInst = new PluginInstallerHelper();
     pInst.InstallPlugin(".\\temp.osapp");
 }