コード例 #1
0
ファイル: TradeDiaryView.cs プロジェクト: Ales999/plena
        private void InitializeCurrentParagraphStyles(StyleDefinition styleDefinition)
        {
            Paragraph        paragraph     = this.radRichTextBox1.Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph;
            RadTextAlignment textAlignment = paragraph.TextAlignment;

            ListNumberingFormat?format = null;

            if (paragraph.IsInList)
            {
                format = paragraph.ListItemInfo.List.Style.Levels[paragraph.ListItemInfo.ListLevel].NumberingFormat;
            }
        }
コード例 #2
0
        private void radBtnAlignJustify_ToggleStateChanged(object sender, StateChangedEventArgs args)
        {
            if (stylesInitializing)
            {
                return;
            }

            RadTextAlignment textAlignment = RadTextAlignment.Left;

            if (args.ToggleState == ToggleState.On)
            {
                textAlignment = RadTextAlignment.Justify;
            }

            this.radRichTextBox1.ChangeTextAlignment(textAlignment);
            this.radRichTextBox1.Focus();
        }
コード例 #3
0
        private void InitializeCurrentParagraphStyles(StyleDefinition styleDefinition)
        {
            Paragraph        paragraph     = this.radRichTextBox1.Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph;
            RadTextAlignment textAlignment = paragraph.TextAlignment;

            this.radBtnAligntLeft.ToggleState   = textAlignment == RadTextAlignment.Left ? ToggleState.On : ToggleState.Off;
            this.radBtnAlignCenter.ToggleState  = textAlignment == RadTextAlignment.Center ? ToggleState.On : ToggleState.Off;
            this.radBtnAligntRight.ToggleState  = textAlignment == RadTextAlignment.Right ? ToggleState.On : ToggleState.Off;
            this.radBtnAlignJustify.ToggleState = textAlignment == RadTextAlignment.Justify ? ToggleState.On : ToggleState.Off;

            ListNumberingFormat?format = null;

            if (paragraph.IsInList)
            {
                format = paragraph.ListItemInfo.List.Style.Levels[paragraph.ListItemInfo.ListLevel].NumberingFormat;
            }

            this.radBtnBulletList.ToggleState = format == ListNumberingFormat.Bullet ?
                                                ToggleState.On : ToggleState.Off;

            this.radNumberingList.ToggleState = format == ListNumberingFormat.Decimal ?
                                                ToggleState.On : ToggleState.Off;
        }