コード例 #1
0
        private void templateToolStripButton_Click(object sender, EventArgs e)
        {
            if (TemplatePanel == null || TemplatePanel.IsDisposed)
            {
                TemplatePanel = new TemplatePanel();
                TemplatePanel.Show(this.dockPanel);
                templateToolStripButton.Checked = true;
                return;
            }

            if (templateToolStripButton.Checked)
            {
                TemplatePanel.Hide();
            }
            else
            {
                TemplatePanel.Show(this.dockPanel);
            }

            templateToolStripButton.Checked = !templateToolStripButton.Checked;
        }
コード例 #2
0
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        object[] body = message.Params;
        switch (name)
        {
        case MessageConst.MODULE_LOVEDIARY_SHOW_TEMPLATE_PANEL:
            if (_templatePanel == null)
            {
                _templatePanel = new TemplatePanel();
                _templatePanel.Init(this);
                DateTime Dt = (DateTime)body[0];
                _templatePanel.SetData(Dt);
            }
            _templatePanel.Show(0);

            break;

        case MessageConst.MODULE_LOVEDIARY_SHOW_EDIT_PANEL:
            if (_templatePanel != null)
            {
                _templatePanel.Hide();
            }
            if (_loveDiaryEditPanel == null)
            {
                _loveDiaryEditPanel = new LoveDiaryEditPanel();
                _loveDiaryEditPanel.Init(this);
            }
            _loveDiaryEditPanel.Show(0);

            _loveDiaryEditPanel.SetData((LoveDiaryEditType)body[0], (CalendarDetailVo)body[1]);
            break;

        case MessageConst.MODULE_LOVEDIARY_SHOW_CALENDAR_PANEL:
            if (_templatePanel != null)
            {
                _templatePanel.Destroy();
                _templatePanel = null;
            }

            if (_loveDiaryEditPanel != null)
            {
                _loveDiaryEditPanel.Destroy();
                _loveDiaryEditPanel = null;
            }
            _calendarPanel.Show(0);
            _calendarPanel.UpdatePanel();
            break;

        case MessageConst.MODULE_LOVEDIARY_SHOW_CALENDARORTEMPLATE_PANEL:
            if (_loveDiaryEditPanel != null)
            {
                _loveDiaryEditPanel.Destroy();
                _loveDiaryEditPanel = null;
            }
            if (_templatePanel != null)
            {
                _templatePanel.Show(0);
            }
            else
            {
                _calendarPanel.Show(0);
                _calendarPanel.UpdatePanel();
            }
            break;
        }
    }