Пример #1
0
        public void Subscribe(EnterMainForm enterMainForm, ViewExplorer viewExplorer, Canvas canvas, LinkedRecordsViewer linkedRecordsViewer)
        {
            this.mainForm            = enterMainForm;
            this.viewExplorer        = viewExplorer;
            this.canvas              = canvas;
            this.linkedRecordsViewer = linkedRecordsViewer;

            viewExplorer.OpenPageEvent   += new OpenPageEventHandler(this.OpenPageHandler);
            viewExplorer.ClosePageEvent  += new ClosePageEventHandler(this.ClosePageHandler);
            viewExplorer.GotoRecordEvent += new GotoRecordEventHandler(this.GoToRecordHandler);

            enterMainForm.GotoRecordEvent          += new GotoRecordEventHandler(this.GoToRecordHandler);
            enterMainForm.OpenViewEvent            += new OpenViewEventHandler(this.OpenViewHandler);
            enterMainForm.CloseViewEvent           += new CloseViewEventHandler(this.CloseViewHandler);
            enterMainForm.SaveRecordEvent          += new SaveRecordEventHander(this.SaveRecordHandler);
            enterMainForm.MarkAsDeletedRecordEvent += new EventHandler(this.MarkAsDeletedRecordHandler);
            enterMainForm.UnMarkDeletedRecordEvent += new EventHandler(this.UnMarkDeletedRecordHandler);
            enterMainForm.CloseFormEvent           += new EventHandler(this.CloseFormEventHandler);

            canvas.GotoFieldEvent        += new OpenFieldEventHandler(this.OpenFieldHandler);
            canvas.CloseFieldEvent       += new CloseFieldEventHandler(this.CloseFieldHandler);
            canvas.ClickFieldEvent       += new ClickFieldEventHandler(this.ClickFieldHandler);
            canvas.DirtyFieldEvent       += new DirtyFieldEventHandler(this.DirtyFieldHandler);
            canvas.DataGridRowAddedEvent += new DataGridViewRowEventHandler(this.DataGridRowAddedHandler);

            this.DisplayFormat += new EventHandler(mediator_DisplayFormat);
        }
Пример #2
0
 public void SetAllReferencesToNull()
 {
     this.form            = null;
     this.container       = null;
     this.moduleManager   = null;
     this.ProjectFilePath = null;
     this.SelectedView    = null;
 }
Пример #3
0
 public void UnSubscribe()
 {
     this.Controls.Clear();
     this.host              = null;
     this.dashboard         = null;
     this.host              = null;
     this.enterMainForm     = null;
     this.currentView       = null;
     this.db                = null;
     this.loadedRuntimeView = null;
 }
Пример #4
0
        /// <summary>
        /// Disposes of the module's container and components
        /// </summary>
        public void Dispose()
        {
            // trash container and any components
            if (this.container != null)
            {
                this.container.Dispose();
            }

            form = null;

            // base class will finish the job
            //base.Dispose();
        }
Пример #5
0
        public MapViewer(EnterMainForm enterMainForm)
        {
            InitializeComponent();

            host      = new ElementHost();
            host.Dock = DockStyle.Fill;
            this.toolStripContainer1.ContentPanel.Controls.Add(host);

            worker                     = new BackgroundWorker();
            worker.DoWork             += new DoWorkEventHandler(worker_DoWork);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
            worker.RunWorkerAsync();

            this.enterMainForm = enterMainForm;
        }
        /// <summary>
        /// Constructor for AutoSearch Results dialog
        /// </summary>
        /// <param name="view">The current view</param>
        /// <param name="mainForm">Enter module's main form</param>
        /// <param name="data">Data table containing auto search results</param>
        public AutoSearchResults(View view, EnterMainForm mainForm, DataTable data, bool showContinueNewMessage = false)
            : base(mainForm)
        {
            #region Input Validation

            if (view == null)
            {
                {
                    throw new ArgumentNullException("view");
                }
            }

            #endregion Input Validation

            InitializeComponent();
            //this.view = view;
            this.mainForm = mainForm;

            // set DataGridView properties
            this.dataGrid1.SelectionMode            = DataGridViewSelectionMode.FullRowSelect;
            this.dataGrid1.AllowUserToAddRows       = false;
            this.dataGrid1.AllowUserToDeleteRows    = false;
            this.dataGrid1.AllowUserToOrderColumns  = false;
            this.dataGrid1.AllowUserToResizeRows    = false;
            this.dataGrid1.AllowUserToResizeColumns = true;
            this.dataGrid1.AllowDrop   = false;
            this.dataGrid1.MultiSelect = false;

            // add event handlers
            this.dataGrid1.KeyDown          += new KeyEventHandler(OnKeyDown);
            this.btnOK.KeyDown              += new KeyEventHandler(OnKeyDown);
            this.btnCancel.KeyDown          += new KeyEventHandler(OnKeyDown);
            this.KeyDown                    += new KeyEventHandler(OnKeyDown);
            base.KeyDown                    += new KeyEventHandler(OnKeyDown);
            this.dataGrid1.SelectionChanged += new EventHandler(dataGrid1_SelectionChanged);

            this.lblOKInstructions.Visible     = !showContinueNewMessage;
            this.lblCancelInstructions.Visible = !showContinueNewMessage;
            this.lblContinueNewMessage.Visible = showContinueNewMessage;
            this.btnCancel.Visible             = !showContinueNewMessage;
            if (showContinueNewMessage)
            {
                btnOK.Location = new Point(230, 270);
            }
            this.lblContinueNew2.Visible = showContinueNewMessage;
            DisplayResults(data);
        }
Пример #7
0
        /// <summary>
        /// Constructor for FindRecords dialog
        /// </summary>
        /// <param name="view">The current view</param>
        /// <param name="mainForm">Enter module's main form</param>
        public FindRecords(View view, EnterMainForm mainForm)
            : base(mainForm)
        {
            #region Input Validation
            if (view == null)
            {
                {
                    throw new ArgumentNullException("view");
                }
            }
            #endregion Input Validation

            InitializeComponent();
            this.view = view;
            this.mainForm = mainForm;
            this.KeyPreview = true;
        }
 public LinkedRecordsViewer(EnterMainForm mainForm)
 {
     InitializeComponent();
     this.enterMainForm                 = mainForm;
     mainForm.OpenViewEvent            += new Epi.Windows.Enter.PresentationLogic.GuiMediator.OpenViewEventHandler(mainForm_OpenViewEvent);
     mainForm.CloseViewEvent           += new Epi.Windows.Enter.PresentationLogic.GuiMediator.CloseViewEventHandler(mainForm_CloseViewEvent);
     lvLinkedFrom.DoubleClick          += new EventHandler(lvLinkedFrom_DoubleClick);
     lvLinkedTo.DoubleClick            += new EventHandler(lvLinkedTo_DoubleClick);
     lvLinkedFrom.SelectedIndexChanged += new EventHandler(lvLinkedFrom_SelectedIndexChanged);
     lvLinkedTo.SelectedIndexChanged   += new EventHandler(lvLinkedTo_SelectedIndexChanged);
     lvLinkedTo.ItemMouseHover         += new ListViewItemMouseHoverEventHandler(lvLinkedTo_ItemMouseHover);
     lvLinkedFrom.ItemMouseHover       += new ListViewItemMouseHoverEventHandler(lvLinkedFrom_ItemMouseHover);
     lvLinkedTo.MouseLeave             += new EventHandler(lvLinkedTo_MouseLeave);
     lvLinkedFrom.MouseLeave           += new EventHandler(lvLinkedFrom_MouseLeave);
     //lvLinkedTo.LostFocus += LvLinkedTo_LostFocus;
     //lvLinkedFrom.LostFocus += LvLinkedFrom_LostFocus;
 }
Пример #9
0
        /// <summary>
        /// Constructor for FindRecords dialog
        /// </summary>
        /// <param name="selectedView">The current view</param>
        /// <param name="mainForm">Enter module's main form</param>
        public FindRecords(View selectedView, EnterMainForm mainForm, View currentView = null)
            : base(mainForm)
        {
            #region Input Validation
            if (selectedView == null)
            {
                {
                    throw new ArgumentNullException("view");
                }
            }
            #endregion Input Validation

            InitializeComponent();
            this.selectedView = selectedView;
            this.currentView  = currentView;
            this.mainForm     = mainForm;
            this.KeyPreview   = true;
        }
Пример #10
0
        public AnalyticsViewer(EnterMainForm enterMainForm)
        {
            InitializeComponent();

            if (System.Windows.Application.Current == null)
            {
                new System.Windows.Application();
            }

            host      = new ElementHost();
            host.Dock = DockStyle.Fill;
            this.toolStripContainer1.ContentPanel.Controls.Add(host);
            this.enterMainForm = enterMainForm;

            this.toolStripContainer1.TopToolStripPanel.Visible = false;

            this.Shown += new EventHandler(AnalyticsViewer_Shown);
        }
Пример #11
0
 /// <summary>
 /// Constructor for YesNo dialog
 /// </summary>
 /// <param name="mainForm">Enter module's main form</param>
 public YesNo(EnterMainForm mainForm)
     : base(mainForm)
 {
     InitializeComponent();
 }
Пример #12
0
 /// <summary>
 /// Constructor for New Record dialog
 /// </summary>
 /// <param name="mainForm">Enter module's main form</param>
 public NewRecord(EnterMainForm mainForm)
     : base(mainForm)
 {
     InitializeComponent();
 }
Пример #13
0
 /// <summary>
 /// Constructor for SelectATable dialog
 /// </summary>
 /// <param name="mainForm">Enter module's main form</param>
 public SelectATable(EnterMainForm mainForm)
     : base(mainForm)
 {
     InitializeComponent();
 }
Пример #14
0
 /// <summary>
 /// Constructor for YesNo dialog
 /// </summary>
 /// <param name="mainForm">Enter module's main form</param>
 public YesNo(EnterMainForm mainForm)
     : base(mainForm)
 {
     InitializeComponent();
 }
Пример #15
0
        /*
         * private bool MsgResponse(EpiMessages msg, MessageType msgtype)
         * {
         *  MessageBoxButtons buttons;
         *  switch (msgtype)
         *  {
         *      case MessageType.OkOnly:
         *          buttons = MessageBoxButtons.OK;
         *          MessageBox.Show(msg.Message, msg.Caption, buttons);
         *          return true;
         *      case MessageType.YesNo:
         *          buttons = MessageBoxButtons.YesNo;
         *          DialogResult result;
         *          result = MessageBox.Show(msg.Message, msg.Caption, buttons);
         *          if (result == DialogResult.Yes)
         *          {
         *              return true;
         *          }
         *          else
         *          {
         *              return false;
         *          }
         *      default:
         *          return false;
         *  }
         * }*/

        #endregion  //Private Methods

        #region Protected Methods

        /// <summary>
        /// Attach the current project with module loading
        /// </summary>
        public void Load(IModuleManager moduleManager, ICommandLine commandLine)
        {
            //base.Load(moduleManager, commandLine);
            this.moduleManager = moduleManager;
            try
            {
                if (form == null)
                {
                    form = new EnterMainForm(this);
                    container.Add(form);
                    form.Closed   += new EventHandler(MainForm_Closed);
                    form.Disposed += new EventHandler(MainForm_Disposed);
                    form.Show();
                    form.Activate();

                    // assure handle creation
                    System.IntPtr handle = form.Handle;

                    // read the command line
                    if (commandLine != null)
                    {
                        string titleArgument = commandLine.GetArgument("title");
                        if (titleArgument != null)
                        {
                            form.Text = titleArgument;
                        }

                        if (commandLine.GetArgument("project") != null)
                        {
                            Project p = new Project(commandLine.GetArgument("project"));
                            form.FireOpenViewEvent(p.Views[commandLine.GetArgument("view")]);
                        }
                        else
                        {
                            if (!form.IsDisposed)
                            {
                                form.Show();
                                if (form.WindowState == FormWindowState.Minimized)
                                {
                                    form.WindowState = FormWindowState.Normal;
                                }
                                form.Activate();
                            }
                        }
                    }
                    //base.OnLoaded();
                }
                else
                {
                    if (!form.IsDisposed)
                    {
                        form.Show();
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                        form.Activate();
                    }
                }
            }
            finally
            {
            }

            //Processor.CommunicateUI += new CommunicateUIEventHandler(MsgResponse);
        }
Пример #16
0
 /// <summary>
 /// Constructor for SelectATable dialog
 /// </summary>
 /// <param name="mainForm">Enter module's main form</param>
 public SelectATable(EnterMainForm mainForm)
     : base(mainForm)
 {
     InitializeComponent();
 }
        public void Subscribe(EnterMainForm enterMainForm, ViewExplorer viewExplorer, Canvas canvas, LinkedRecordsViewer linkedRecordsViewer)
        {
            this.mainForm = enterMainForm;
            this.viewExplorer = viewExplorer;
            this.canvas = canvas;
            this.linkedRecordsViewer = linkedRecordsViewer;

            viewExplorer.OpenPageEvent += new OpenPageEventHandler(this.OpenPageHandler);
            viewExplorer.ClosePageEvent += new ClosePageEventHandler(this.ClosePageHandler);
            viewExplorer.GotoRecordEvent += new GotoRecordEventHandler(this.GoToRecordHandler);

            enterMainForm.GotoRecordEvent += new GotoRecordEventHandler(this.GoToRecordHandler);
            enterMainForm.OpenViewEvent += new OpenViewEventHandler(this.OpenViewHandler);
            enterMainForm.CloseViewEvent += new CloseViewEventHandler(this.CloseViewHandler);
            enterMainForm.SaveRecordEvent += new SaveRecordEventHander(this.SaveRecordHandler);
            enterMainForm.MarkAsDeletedRecordEvent += new EventHandler(this.MarkAsDeletedRecordHandler);
            enterMainForm.UnMarkDeletedRecordEvent += new EventHandler(this.UnMarkDeletedRecordHandler);
            enterMainForm.CloseFormEvent += new EventHandler(this.CloseFormEventHandler);

            canvas.GotoFieldEvent += new OpenFieldEventHandler(this.OpenFieldHandler);
            canvas.CloseFieldEvent += new CloseFieldEventHandler(this.CloseFieldHandler);
            canvas.ClickFieldEvent += new ClickFieldEventHandler(this.ClickFieldHandler);
            canvas.DirtyFieldEvent += new DirtyFieldEventHandler(this.DirtyFieldHandler);
            canvas.DataGridRowAddedEvent += new DataGridViewRowEventHandler(this.DataGridRowAddedHandler);

            this.DisplayFormat += new EventHandler(mediator_DisplayFormat);
        }
Пример #18
0
 /// <summary>
 /// Constructor for New Record dialog
 /// </summary>
 /// <param name="mainForm">Enter module's main form</param>
 public NewRecord(EnterMainForm mainForm)
     : base(mainForm)
 {
     InitializeComponent();
 }