private FieldDefinitionDialogFactory(IServiceProvider serviceProvider)
 {
     this.serviceProvider = serviceProvider;
     //this.mainForm = serviceProvider.GetService(typeof(MainForm)) as MainForm;
     //zack 8/10/2008
     this.mainForm = serviceProvider.GetService(typeof(Epi.Windows.MakeView.Forms.MakeViewMainForm)) as Epi.Windows.MakeView.Forms.MakeViewMainForm;
 }
Пример #2
0
 /// <summary>
 /// Constructor for Dialog dialog
 /// </summary>
 /// <param name="frm">The main form</param>
 public DialogDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
     : base(frm)
 {
     InitializeComponent();
     mainForm = frm;
     Construct();
 }
Пример #3
0
 private FieldDefinitionDialogFactory(IServiceProvider serviceProvider)
 {
     this.serviceProvider = serviceProvider;
     //this.mainForm = serviceProvider.GetService(typeof(MainForm)) as MainForm;
     //zack 8/10/2008
     this.mainForm = serviceProvider.GetService(typeof(Epi.Windows.MakeView.Forms.MakeViewMainForm)) as Epi.Windows.MakeView.Forms.MakeViewMainForm;
 }
Пример #4
0
        private void LoadInputVars(ComboBox cmb)
        {
            try
            {
                VariableScope scopeWord = VariableScope.Standard | VariableScope.Global | VariableScope.Permanent | VariableScope.DataSource;

                Epi.Windows.MakeView.Forms.MakeViewMainForm m = (Epi.Windows.MakeView.Forms.MakeViewMainForm)mainForm;
                this.EpiInterpreter = m.EpiInterpreter;

                List <EpiInfo.Plugin.IVariable> vars = this.EpiInterpreter.Context.GetVariablesInScope(scopeWord);



                if (cmb.Items.Count <= 0)
                {
                    cmb.Items.Clear();
                    foreach (EpiInfo.Plugin.IVariable var in vars)
                    {
                        if (var.Name != ColumnNames.REC_STATUS && var.Name != ColumnNames.UNIQUE_KEY)
                        {
                            cmb.Items.Add(var.Name.ToString());
                        }
                    }
                    // TODO - will need to put variable type somewhere
                    //cmb.DataSource = GetDefinedVars().DefaultView;
                    //cmb.DisplayMember = ColumnNames.NAME;
                    //cmb.ValueMember = ColumnNames.DATA_TYPE;
                    cmb.SelectedIndex = -1;
                }
            }
            catch (Exception ex)
            {
            }
        }
 /// <summary>
 /// Constructor for the Relate Field Definition
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="page">The page</param>
 public RelateFieldDefinition(Epi.Windows.MakeView.Forms.MakeViewMainForm frm, Page page)
     : base(frm)
 {
     InitializeComponent();
     this.memoryRegion = frm.EpiInterpreter;
     this.mode         = FormMode.Create;
     this.page         = page;
 }
Пример #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="frm">The main form</param>
 public EditorToolWindow(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
     : base(frm)
 {
     InitializeComponent();
     declaredVariables           = new Collection <string>();
     this.txtTextArea.AcceptsTab = true;
     this.memoryRegion           = frm.EpiInterpreter;
 }
Пример #7
0
 /// <summary>
 /// Constructor for Dialog dialog that passes the project
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="project">The current project</param>
 public DialogDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm, Project project)
     : base(frm)
 {
     InitializeComponent();
     mainForm     = frm;
     this.project = project;
     Construct();
 }
        private void LoadTables()
        {
            DataTable bindingTable = currentProject.CodeData.GetCodeTableNamesForProject(currentProject);

            string collectedDataTableName = string.Empty;

            DataTable pages;

            Epi.Windows.MakeView.Forms.MakeViewMainForm makeViewMainForm = ((Epi.Windows.MakeView.Forms.MakeViewMainForm) this.mainForm);
            View currentView = makeViewMainForm.projectExplorer.currentPage.view;

            foreach (View view in currentView.GetProject().Views)
            {
                pages = currentProject.Metadata.GetPagesForView(view.Id);

                foreach (DataRow row in pages.Rows)
                {
                    collectedDataTableName = string.Format("{0} - {1}", view.Name, row["Name"].ToString());

                    if (!string.IsNullOrEmpty(collectedDataTableName))
                    {
                        bindingTable.Rows.Add(new string[] { collectedDataTableName });
                    }
                }
            }

            DataView dataView = bindingTable.DefaultView;

            string display        = String.Empty;
            string kindOfDatabase = currentProject.CodeData.IdentifyDatabase();

            //TODO: Will need to rework this section not to be dependant on strings and develop a
            // more OO solution
            switch (kindOfDatabase)
            {
            case "ACCESS":
                display = ColumnNames.NAME;
                break;

            case "SQLSERVER":
                display = ColumnNames.SCHEMA_TABLE_NAME;
                break;

            case "MYSQL":
                display = ColumnNames.SCHEMA_TABLE_NAME;
                break;

            default:
                display = ColumnNames.SCHEMA_TABLE_NAME;
                break;
            }
            dataView.Sort           = display;
            lbxTables.DataSource    = dataView.ToTable(true, new string[] { display });
            lbxTables.DisplayMember = display;
            lbxTables.ValueMember   = display;
        }
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="frm">The parent form</param>
 /// <param name="field">The fied to be edited</param>
 public RelateFieldDefinition(Epi.Windows.MakeView.Forms.MakeViewMainForm frm, RelatedViewField field)
     : base(frm)
 {
     InitializeComponent();
     this.mode         = FormMode.Edit;
     this.field        = field;
     this.page         = field.Page;
     this.memoryRegion = frm.EpiInterpreter;
     LoadFormData();
 }
Пример #10
0
 /// <summary>
 /// Constructor for QuitDialog. if showSave is true btnShowSaveOnly is enabled during form load.
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="showSave">Boolean to denote whether to display the Show Only button on the dialog</param>
 public QuitDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm, bool showSave)
     : base(frm)
 {
     InitializeComponent();
     showSaveOnly = showSave;
     if (showSaveOnly)
     {
         this.btnSaveOnly.Click += new System.EventHandler(this.btnSaveOnly_Click);
     }
     Construct();
 }
Пример #11
0
 /// <summary>
 /// Constructor for AssignDialog.  if showSave, enable the SaveOnly button
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="showSave">Boolean to denote whether to display Save Only button on dialog</param>
 public AssignDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm, bool showSave)
     : base(frm)
 {
     InitializeComponent();
     if (showSave)
     {
         showSaveOnly            = false;
         this.btnSaveOnly.Click += new System.EventHandler(this.btnSaveOnly_Click);
         Construct();
     }
 }
Пример #12
0
        static void Main(string[] args)
        {
            System.Windows.Forms.Application.EnableVisualStyles();

            if (LoadConfiguration())
            {
                try
                {
                    Configuration.Environment = ExecutionEnvironment.WindowsApplication;
                    string path           = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                    string executablePath = System.IO.Path.Combine(path, "EpiInfo.exe");
                    Epi.Windows.MakeView.Forms.MakeViewMainForm makeViewMainForm = new Epi.Windows.MakeView.Forms.MakeViewMainForm();
                    ICommandLine commandLine = new CommandLine(args);

                    string titleArgument = commandLine.GetArgument("title");
                    string projectPath   = commandLine.GetArgument("project");
                    string viewName      = commandLine.GetArgument("view");

                    if (titleArgument != null)
                    {
                        makeViewMainForm.Text = titleArgument;
                    }

                    if (!string.IsNullOrEmpty(projectPath))
                    {
                        makeViewMainForm.LoadViewFromCommandLine(projectPath, viewName);
                    }
                    else
                    {
                        if (!makeViewMainForm.IsDisposed)
                        {
                            makeViewMainForm.Show();
                            if (makeViewMainForm.WindowState == FormWindowState.Minimized)
                            {
                                makeViewMainForm.WindowState = FormWindowState.Normal;
                            }
                            makeViewMainForm.Activate();
                        }

                        if (args.Length > 0 && args[0] is string && System.IO.File.Exists(args[0]))
                        {
                            makeViewMainForm.GetTemplate(args[0]);
                        }
                    }

                    System.Windows.Forms.Application.Run(makeViewMainForm);
                    makeViewMainForm = null;
                }
                catch (Exception ex)
                {
                    MsgBox.ShowException(ex);
                }
            }
        }
Пример #13
0
        static void Main(string[] args)
        {
            System.Windows.Forms.Application.EnableVisualStyles();

            if (LoadConfiguration())
            {
                try
                {
                    Configuration.Environment = ExecutionEnvironment.WindowsApplication;
                    string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                    string executablePath = System.IO.Path.Combine(path, "EpiInfo.exe");
                    Epi.Windows.MakeView.Forms.MakeViewMainForm makeViewMainForm = new Epi.Windows.MakeView.Forms.MakeViewMainForm();
                    ICommandLine commandLine = new CommandLine(args);

                    string titleArgument = commandLine.GetArgument("title");
                    string projectPath = commandLine.GetArgument("project");
                    string viewName = commandLine.GetArgument("view");

                    if (titleArgument != null)
                    {
                        makeViewMainForm.Text = titleArgument;
                    }

                    if (! string.IsNullOrEmpty(projectPath))
                    {
                        makeViewMainForm.LoadViewFromCommandLine(projectPath, viewName);
                    }
                    else
                    {
                        if (!makeViewMainForm.IsDisposed)
                        {
                            makeViewMainForm.Show();
                            if (makeViewMainForm.WindowState == FormWindowState.Minimized)
                            {
                                makeViewMainForm.WindowState = FormWindowState.Normal;
                            }
                            makeViewMainForm.Activate();
                        }

                        if (args.Length > 0 && args[0] is string && System.IO.File.Exists(args[0]))
                        {
                            makeViewMainForm.GetTemplate(args[0]);
                        }
                    }

                    System.Windows.Forms.Application.Run(makeViewMainForm);
                    makeViewMainForm = null;
                }
                catch(Exception ex)
                {
                    MsgBox.ShowException(ex);
                }
            }
        }
Пример #14
0
        /// <summary>
        /// Constructor for Command Design Dialog
        /// </summary>
        /// <param name="frm">The main form</param>
        public CommandDesignDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
            : base(frm)
        {
            InitializeComponent();
            this.EpiInterpreter = frm.EpiInterpreter;

            //dialogCommandProcessor = Module.GetService(typeof(ICommandProcessor)) as ICommandProcessor;
            //if (dialogCommandProcessor == null)
            //{
            //    throw new GeneralException("Command processor is required but not available.");
            //}
        }
        /// <summary>
        /// Dialog to select a tble
        /// </summary>
        /// <param name="frm">The main form</param>
        public TableSelectionDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
            : base(frm)
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();


            if (frm.projectExplorer != null)
            {
                if (frm.projectExplorer.currentPage != null)
                {
                    this.project          = frm.projectExplorer.currentPage.view.Project;
                    this.MetaDataProvider = this.project.Metadata;
                }
            }
        }
Пример #16
0
 /// <summary>
 /// Constructor for DefineVariable dialog
 /// </summary>
 public DefineVariableDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
     : base(frm)
 {
     InitializeComponent();
     Construct();
 }
Пример #17
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="frm">The main form</param>
 public FieldSelectorDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
     : base(frm)
 {
     InitializeComponent();
     this.EpiInterpreter = frm.EpiInterpreter;
 }
Пример #18
0
        /// <summary>
        /// Constructor for Read dialog
        /// </summary>
        public ReadDialog(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
            : base(frm)
        {
            InitializeComponent();
            Construct();
            SourceProjectNames = new Hashtable();

            if (frm.projectExplorer != null)
            {
                if (frm.projectExplorer.currentPage != null)
                {
                    this.sourceProject      = frm.projectExplorer.currentPage.view.Project;
                    this.selectedProject    = this.sourceProject;
                    this.selectedDataSource = this.selectedProject;
                    //--EI-48
                    //Adds datatable names to viewlist to enable other tables in project
                    List <string> SourceViewnames = this.sourceProject.GetViewNames();
                    SourceNonViewnames = this.sourceProject.GetNonViewTableNames();
                    foreach (string str in SourceViewnames)
                    {
                        View      MView     = this.sourceProject.GetViewByName(str);
                        DataTable ViewPages = MView.GetMetadata().GetPagesForView(MView.Id);
                        foreach (DataRow dt in ViewPages.Rows)
                        {
                            string ViewdataTable = MView.TableName + dt[ColumnNames.PAGE_ID];
                            Sourcedatatables.Add(ViewdataTable);
                        }
                        if (SourceNonViewnames.Contains(str))
                        {
                            SourceNonViewnames.Remove(str);
                        }
                    }
                    foreach (string str in Sourcedatatables)
                    {
                        SourceViewnames.Add(str);
                        if (SourceNonViewnames.Contains(str))
                        {
                            SourceNonViewnames.Remove(str);
                        }
                    }

                    //--

                    foreach (string s in this.sourceProject.GetNonViewTableNames())
                    {
                        string key = s.ToUpperInvariant().Trim();
                        if (!SourceProjectNames.Contains(key))
                        {
                            if (SourceViewnames.Contains(s))
                            {
                                SourceProjectNames.Add(key, true);
                            }
                        }
                    }
                    foreach (string s in this.sourceProject.GetViewNames())
                    {
                        string key = s.ToUpperInvariant().Trim();
                        if (!SourceProjectNames.Contains(key))
                        {
                            SourceProjectNames.Add(key, true);
                        }
                    }
                }
            }
        }
 /// <summary>
 /// Constructor for the Relate Field Definition
 /// </summary>
 /// <param name="frm">The main form</param>
 public RelateFieldDefinition(Epi.Windows.MakeView.Forms.MakeViewMainForm frm)
     : base(frm)
 {
     InitializeComponent();
     this.memoryRegion = frm.EpiInterpreter;
 }