Ejemplo n.º 1
0
        private void cboTheme_SelectedIndexChanged(object sender, EventArgs e)
        {
            try {
                string text = cboTheme.Text;
                switch (text)
                {
                case STYLE_BLUE_WHITE:
                    m_style = Cube.AFD.Windows.Controls.CalendarControls.CalendarStyle.BlueWhite;
                    break;

                case STYLE_COOL_EYE:
                    m_style = Cube.AFD.Windows.Controls.CalendarControls.CalendarStyle.CoolEye;
                    break;

                case STYLE_PIG_BLOOD:
                    m_style = Cube.AFD.Windows.Controls.CalendarControls.CalendarStyle.PigBlood;
                    break;

                case STYLE_PIG_BLLOD2:
                    m_style = Cube.AFD.Windows.Controls.CalendarControls.CalendarStyle.PigBlood2;
                    break;

                case STYLE_PINK_SMOOTH:
                    m_style = Cube.AFD.Windows.Controls.CalendarControls.CalendarStyle.PinkSmooth;
                    break;
                }
                if (trevStyle.SelectedNode != null)
                {
                    SetPropertyObject(trevStyle.SelectedNode.Text);
                }
                m_calendar.InvalidateAll();
            } catch (Exception ex) {
                MessageBox.Show(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public CalendarEditor(IDesigner designer, CalendarStyle style, Calendar calendar)
        {
            InitializeComponent();
            m_designer = designer;
            m_style    = style;
            trevStyle.ExpandAll();
            m_calendar = calendar;
            propertyGrid1.SelectedObject = null;

            cboTheme.Items.Clear();
            cboTheme.Items.Add(STYLE_CUSTOM);
            cboTheme.Items.Add(STYLE_COOL_EYE);
            cboTheme.Items.Add(STYLE_BLUE_WHITE);
            cboTheme.Items.Add(STYLE_PIG_BLOOD);
            cboTheme.Items.Add(STYLE_PIG_BLLOD2);
            cboTheme.Items.Add(STYLE_PINK_SMOOTH);

            cboTheme.Text = STYLE_CUSTOM;

            // Calendar Type
            switch (calendar.CalendarType)
            {
            case CalendarType.Region: rdCRegion.Checked = true; break;

            case CalendarType.Gregorian: rdCGregorian.Checked = true; break;

            case CalendarType.ThaiBuddhist: rdCThaiBuddhist.Checked = true; break;
            }

            // Calendar View
            calendarLayoutControl1.LayoutType = m_calendar.CalendarView;

            // Show Checked Box
            if (calendar.ShowCheckBox)
            {
                rdYes.Checked = true;
            }
            else
            {
                rdNo.Checked = true;
            }

            // Selection Policy
            switch (calendar.SelectionPolicy)
            {
            case SelectionPolicy.Continuous: rdSContinuous.Checked = true; break;

            case SelectionPolicy.Single: rdSSingle.Checked = true; break;

            case SelectionPolicy.Merge: rdSMerge.Checked = true; break;
            }

            // Editor Control
            txtEditorTypeName.Text = calendar.EditorControlType == null ? string.Empty : calendar.EditorControlType.FullName;
            // Editor Mode
            switch (calendar.EditorMode)
            {
            case EditorMode.Alway: rdMAlway.Checked = true; break;

            case EditorMode.DisplayWhenEdit: rdMDisplayWhenEdit.Checked = true; break;
            }
            // Editor View
            switch (calendar.EditorView)
            {
            case EditorView.Default: rdVDefault.Checked = true; break;

            case EditorView.ForeControl: rdVForeControl.Checked = true; break;

            case EditorView.OwnerDraw: rdVOwnerDraw.Checked = true; break;
            }
            // Editor When
            chkDoubleClick.Checked = ((calendar.EditorWhen & EditorWhen.DoubleClick) == EditorWhen.DoubleClick);
            chkPressEnter.Checked  = ((calendar.EditorWhen & EditorWhen.Enter) == EditorWhen.Enter);
            chkPressF2.Checked     = ((calendar.EditorWhen & EditorWhen.F2) == EditorWhen.F2);
        }
Ejemplo n.º 3
0
 public ICollection <Rule> CreateGlobalCss(ITheme theme)
 {
     return(CalendarStyle.GetCalendarStyle(theme));
 }