当前位置: 首页>>代码示例>>C#>>正文


C# RichTextBox.SetValue方法代码示例

本文整理汇总了C#中System.Windows.Controls.RichTextBox.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# RichTextBox.SetValue方法的具体用法?C# RichTextBox.SetValue怎么用?C# RichTextBox.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.RichTextBox的用法示例。


在下文中一共展示了RichTextBox.SetValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetIsEnabled

 public static void SetIsEnabled(RichTextBox richTextBox, bool value)
 {
     if (richTextBox == null)
     {
     throw new ArgumentNullException("richTextBox");
     }
     richTextBox.SetValue(IsEnabledProperty, value);
 }
开发者ID:unbearab1e,项目名称:FlattyTweet,代码行数:8,代码来源:IntellisenseExtension.cs

示例2: CreateGrid

        private Inline CreateGrid(DocTree tree)
        {
            Grid g = new Grid();
            int rowMax = 0; int colMax = 0;
            Dictionary<int, Dictionary<int, RichTextBox>> cells = new Dictionary<int, Dictionary<int, RichTextBox>>();
            foreach (var child in tree.Children)
            {
                Span span = new Span();
                DocTreeToTextElement(child, span.Inlines);

                int row = child.Row - 1;
                int col = child.Column - 1;
                if (!cells.ContainsKey(col))
                    cells.Add(col, new Dictionary<int, RichTextBox>());
                var column = cells[col];
                if (!column.ContainsKey(row))
                {
                    var spanel = new RichTextBox()
                    {
                        BorderThickness = new Thickness(0),
                        IsReadOnly = true
                    };
                    spanel.SetValue(Grid.ColumnProperty, col);
                    spanel.SetValue(Grid.RowProperty, row);
                    column.Add(row, spanel);
                    g.Children.Add(spanel);
                }
                RichTextBox tb = column[row];
                tb.Selection.Insert(span);
                rowMax = (int)Math.Max(rowMax, child.Row);
                colMax = (int)Math.Max(colMax, child.Column);
            }
            for (int i = 0; i < rowMax; i++)
                g.RowDefinitions.Add(new RowDefinition());
            for (int i = 0; i < colMax; i++)
                g.ColumnDefinitions.Add(new ColumnDefinition());
            InlineUIContainer c = new InlineUIContainer()
            {
                Child = g
            };
            return c;
        }
开发者ID:Esri,项目名称:arcgis-viewer-silverlight,代码行数:42,代码来源:HtmlTextBlock.cs

示例3: SetIgnorePrefix

 public static void SetIgnorePrefix(RichTextBox richTextBox, bool value)
 {
     if (richTextBox == null)
     {
     throw new ArgumentNullException("richTextBox");
     }
     richTextBox.SetValue(IgnorePrefixProperty, value);
 }
开发者ID:unbearab1e,项目名称:FlattyTweet,代码行数:8,代码来源:IntellisenseExtension.cs

示例4: SetExcludeMentions

 public static void SetExcludeMentions(RichTextBox richTextBox, bool value)
 {
     if (richTextBox == null)
     {
     throw new ArgumentNullException("richTextBox");
     }
     richTextBox.SetValue(ExcludeMentionsProperty, value);
 }
开发者ID:unbearab1e,项目名称:FlattyTweet,代码行数:8,代码来源:IntellisenseExtension.cs

示例5: SetBindableDocument

 public static void SetBindableDocument(RichTextBox obj, FlowDocument value)
 {
     obj.SetValue(BindableDocumentProperty, value);
 }
开发者ID:schuster-rainer,项目名称:scripting-shell,代码行数:4,代码来源:BindableRichTextBox.cs

示例6: SetPreventTextInput

 public static void SetPreventTextInput(RichTextBox obj,
                         bool value)
 {
     obj.SetValue(PreventTextInputProperty, value);
 }
开发者ID:ArildF,项目名称:linqtwit,代码行数:5,代码来源:RichTextBoxBehavior.cs

示例7: limitSkill_BindData

        private void limitSkill_BindData(LimitSkillMaster skill, ActiveSkillMaster[] laSkill)
        {
            if (skill == null || skill.id == 0) {
                UnitInfo_LimitSkill.Visibility = Visibility.Collapsed;
                return;
            }
            UnitInfo_LimitSkill.Visibility = Visibility.Visible;

            limitSkill_id.Text = skill.id.ToString();
            limitSkill_name.Text = skill.name;
            limitSkill_general_text.Document = Utility.ParseTextToDocument(skill.general_text);
            limitSkill_coefficient.Text = skill.coefficient.ToString();

            UnitInfo_LimitSkill_AS.Children.Clear();
            for (int i = 0; i < 3; i++) {
                ActiveSkillMaster askill = laSkill[i];
                Grid grid = new Grid();
                if (askill.id == 0) {
                    continue;
                }
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
                TextBlock tblTitle = new TextBlock() { FontWeight = FontWeights.Bold, Text = string.Format("L_AS{0}", i.ToString()) };
                tblTitle.SetValue(Grid.ColumnProperty, 0);
                tblTitle.SetValue(Grid.RowProperty, 0);
                grid.Children.Add(tblTitle);
                TextBox tbId = new TextBox() { Text = askill.id.ToString() };
                tbId.SetValue(Grid.ColumnProperty, 1);
                tbId.SetValue(Grid.RowProperty, 0);
                grid.Children.Add(tbId);
                TextBox tbName = new TextBox() { Text = askill.name };
                tbName.SetValue(Grid.ColumnProperty, 2);
                tbName.SetValue(Grid.RowProperty, 0);
                tbName.SetValue(Grid.ColumnSpanProperty, 2);
                grid.Children.Add(tbName);
                RichTextBox rtb = new RichTextBox() { Document = Utility.ParseTextToDocument(askill.text) };
                rtb.SetValue(Grid.ColumnProperty, 0);
                rtb.SetValue(Grid.RowProperty, 1);
                rtb.SetValue(Grid.ColumnSpanProperty, 4);
                grid.Children.Add(rtb);
                TextBlock tblType = new TextBlock() { Text = "type" };
                tblType.SetValue(Grid.ColumnProperty, 0);
                tblType.SetValue(Grid.RowProperty, 2);
                grid.Children.Add(tblType);
                TextBox tbTypeId = new TextBox() { Text = askill.type.ToString() };
                tbTypeId.SetValue(Grid.ColumnProperty, 1);
                tbTypeId.SetValue(Grid.RowProperty, 2);
                grid.Children.Add(tbTypeId);
                TextBox tbType = new TextBox() { Text = Utility.ParseSkillType((ActiveSkillType)askill.type) };
                tbType.SetValue(Grid.ColumnProperty, 2);
                tbType.SetValue(Grid.RowProperty, 2);
                tbType.SetValue(Grid.ColumnSpanProperty, 2);
                grid.Children.Add(tbType);
                TextBlock tblAttr = new TextBlock() { Text = "attribute" };
                tblAttr.SetValue(Grid.ColumnProperty, 0);
                tblAttr.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(tblAttr);
                TextBox tbAttr = new TextBox() { Text = Utility.ParseAttributeToString(askill.attribute) };
                tbAttr.SetValue(Grid.ColumnProperty, 1);
                tbAttr.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(tbAttr);
                TextBox tbSubAttr = new TextBox() { Text = Utility.ParseAttributeToString(askill.sub_attr) };
                tbSubAttr.SetValue(Grid.ColumnProperty, 2);
                tbSubAttr.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(tbSubAttr);
                //gridStyle
                Grid gridStyle = new Grid();
                gridStyle.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(50) });
                gridStyle.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                TextBlock tblStyle = new TextBlock() { Text = "style" };
                tblStyle.SetValue(Grid.ColumnProperty, 0);
                gridStyle.Children.Add(tblStyle);
                TextBox tbStyle = new TextBox() { Text = Utility.ParseStyletype(askill.style) };
                tbStyle.SetValue(Grid.ColumnProperty, 1);
                gridStyle.Children.Add(tbStyle);
                gridStyle.SetValue(Grid.ColumnProperty, 3);
                gridStyle.SetValue(Grid.RowProperty, 3);
                grid.Children.Add(gridStyle);
                //gridInfo
                Grid gridInfo = new Grid();
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                gridInfo.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
                TextBlock tblPhase = new TextBlock() { Text = "phase" };
                tblPhase.SetValue(Grid.ColumnProperty, 0);
                gridInfo.Children.Add(tblPhase);
                TextBox tbPhase = new TextBox() { Text = ((SkillPhase)askill.phase).ToString() };
                tbPhase.SetValue(Grid.ColumnProperty, 1);
                gridInfo.Children.Add(tbPhase);
//.........这里部分代码省略.........
开发者ID:WindWT,项目名称:RTDDE.Executer,代码行数:101,代码来源:Unit.xaml.cs


注:本文中的System.Windows.Controls.RichTextBox.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。