Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            System.Windows.Forms.Application.EnableVisualStyles();

            if (LoadConfiguration(args))
            {
                Configuration.Environment = ExecutionEnvironment.WindowsApplication;

                ICommandLine commandLine = new CommandLine(args);

                //string titleArgument = commandLine.GetArgument("title");
                string scriptPath = commandLine.GetArgument("script");
                string autorun = commandLine.GetArgument("autorun");
                string smallsize = commandLine.GetArgument("smallsize");

                try
                {
                    Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog M = null;
                    bool useSmallSize = false;

                    if (!string.IsNullOrEmpty(smallsize) && smallsize.ToLower().Equals("true"))
                    {
                        useSmallSize = true;
                    }

                    if (!string.IsNullOrEmpty(scriptPath))
                    {
                        M = new Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog(scriptPath, useSmallSize);
                    }
                    else
                    {
                        M = new Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog(useSmallSize);
                    }

                    if (!string.IsNullOrEmpty(autorun) && autorun.ToLower().Equals("true") && M != null)
                    {
                        M.CloseOnFinish = true;
                        M.StartCreatePackage();
                    }

                    //if (!string.IsNullOrEmpty(projectPath))
                    //{
                    //    Project p = new Project(projectPath);
                    //    M.FireOpenViewEvent(p.Views[viewName]);
                    //}
                    //else
                    //{
                        if (!M.IsDisposed)
                        {
                            M.Show();
                            if (M.WindowState == FormWindowState.Minimized)
                            {
                                M.WindowState = FormWindowState.Normal;
                            }
                            M.Activate();
                        }
                    //}

                    System.Windows.Forms.Application.Run(M);
                    M = null;
                }
                catch (Exception ex)
                {
                    //MsgBox.ShowError(SharedStrings.WARNING_APPLICATION_RUNNING);
                    MsgBox.ShowError(string.Format("Error: \n {0}", ex.ToString()));
                }
                finally
                {
                }
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            System.Windows.Forms.Application.EnableVisualStyles();

            if (LoadConfiguration(args))
            {
                Configuration.Environment = ExecutionEnvironment.WindowsApplication;

                ICommandLine commandLine = new CommandLine(args);

                //string titleArgument = commandLine.GetArgument("title");
                string scriptPath = commandLine.GetArgument("script");
                string autorun    = commandLine.GetArgument("autorun");
                string smallsize  = commandLine.GetArgument("smallsize");

                try
                {
                    Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog M = null;
                    bool useSmallSize = false;

                    if (!string.IsNullOrEmpty(smallsize) && smallsize.ToLowerInvariant().Equals("true"))
                    {
                        useSmallSize = true;
                    }

                    if (!string.IsNullOrEmpty(scriptPath))
                    {
                        M = new Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog(scriptPath, useSmallSize);
                    }
                    else
                    {
                        M = new Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog(useSmallSize);
                    }

                    if (!string.IsNullOrEmpty(autorun) && autorun.ToLowerInvariant().Equals("true") && M != null)
                    {
                        M.CloseOnFinish = true;
                        M.StartCreatePackage();
                    }

                    //if (!string.IsNullOrEmpty(projectPath))
                    //{
                    //    Project p = new Project(projectPath);
                    //    M.FireOpenViewEvent(p.Views[viewName]);
                    //}
                    //else
                    //{
                    if (!M.IsDisposed)
                    {
                        M.Show();
                        if (M.WindowState == FormWindowState.Minimized)
                        {
                            M.WindowState = FormWindowState.Normal;
                        }
                        M.Activate();
                    }
                    //}

                    System.Windows.Forms.Application.Run(M);
                    M = null;
                }
                catch (Exception ex)
                {
                    //MsgBox.ShowError(SharedStrings.WARNING_APPLICATION_RUNNING);
                    MsgBox.ShowError(string.Format("Error: \n {0}", ex.ToString()));
                }
                finally
                {
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Method for showing the 'Package for transport' dialog box.
        /// </summary>
        /// <param name="sourceView">The form to be packaged.</param>
        private void PackageForTransport(View sourceView)
        {
            // Do not allow if it's a relational form of any sort
            if (sourceView.IsRelatedView)
            {
                MsgBox.ShowInformation(SharedStrings.ERROR_CREATE_PACKAGE_RELATED_FORM);
                return;
            }

            Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog packageDialog = new Epi.Windows.ImportExport.Dialogs.PackageForTransportDialog(sourceView.Project.FilePath, sourceView);
            DialogResult result = packageDialog.ShowDialog();
        }