Ejemplo n.º 1
0
        private void buttonLogging_Click(object sender, EventArgs e)
        {
            {
                Form logForm = new Form();
                logForm.MdiParent = this;
                logForm.Text = "Log_" + m_ChildFormNumber;
                m_ChildFormNumber++;
                LogControl logControl = new LogControl();
                HandleConstruction(logForm, logControl);

                logForm.FormClosing += logForm_Closing;
                try
                {
                    foreach (var optionForm in MdiChildren)
                    {
                        if (optionForm.Text.StartsWith("Option"))
                        {

                            _ObserverManager.Add(logForm.Text, new ObserverPattern.Observer(optionForm, logForm));
                            LayoutManager optionControl = optionForm.Controls[0] as LayoutManager;
                            optionControl.Subscribe();

                        }
                    }
                }
                catch (Exception)
                {
                    
                    throw;
                }
            }
        }
Ejemplo n.º 2
0
        private void ShowNewLogger()
        {
            Form logForm;
            logForm = new Form();
            ParentStudio parent = (this.Parent as Form).ParentForm as ParentStudio;
            logForm.MdiParent = parent;
            logForm.Text = "Log_" + parent.ChildFormNumber;
            logForm.Tag = parent.ChildFormNumber;
            Tag = parent.ChildFormNumber;
            ParentForm.Tag = Tag;

            parent.ChildFormNumber++;
            LogControl logControl = new LogControl();
            HandleConstruction(logForm, logControl);

            logForm.FormClosing += logForm_Closing;
            try
            {
                _ObserverManager.Add(logForm.Tag.ToString(), new ObserverPattern.Observer(Parent as Form, logForm));
                LayoutManager optionControl = Parent.Controls[0] as LayoutManager;
                optionControl.Subscribe();

            }
            catch (Exception)
            {

                throw;
            }
        }