• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TextStyle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TextStyle的典型用法代码示例。如果您正苦于以下问题:C# TextStyle类的具体用法?C# TextStyle怎么用?C# TextStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextStyle类属于命名空间,在下文中一共展示了TextStyle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BoundedElement

		//=========================================================================================
		public BoundedElement(TextStyle bodyStyle, TextStyle boundStyle, string startSymbols, string endSymbols)
			: base(bodyStyle)
		{
			this.BoundStyle = boundStyle;
			this.StartSymbols = startSymbols;
			this.EndSymbols = endSymbols;
		}
开发者ID:ygavrishov,项目名称:SA.CodeView,代码行数:8,代码来源:BoundedElement.cs


示例2: TextStyle

 /// <summary>
 /// 拷贝的构造函数。
 /// </summary>
 /// <param name="textStyle">TextStyle对象实例。</param>
 public TextStyle(TextStyle textStyle)
 {
     if (textStyle == null) throw new ArgumentNullException();
     this.Align = textStyle.Align;
     if (textStyle.BackColor != null)
         this.BackColor = new Color(textStyle.BackColor);
     this.BackOpaque = textStyle.BackOpaque;
     this.Bold = textStyle.Bold;
     this.FontHeight = textStyle.FontHeight;
     this.FontName = textStyle.FontName;
     this.FontScale = textStyle.FontScale;
     this.FontWeight = textStyle.FontWeight;
     this.FontWidth = textStyle.FontWidth;
     if (textStyle.ForeColor != null)
         this.ForeColor = new Color(textStyle.ForeColor);
     this.Italic = textStyle.Italic;
     this.ItalicAngle = textStyle.ItalicAngle;
     this.OpaqueRate = textStyle.OpaqueRate;
     this.Outline = textStyle.Outline;
     this.Rotation = textStyle.Rotation;
     this.Shadow = textStyle.Shadow;
     this.SizeFixed = textStyle.SizeFixed;
     this.Strikeout = textStyle.Strikeout;
     this.Underline = textStyle.Underline;
 }
开发者ID:SuperMap,项目名称:iClient-for-DotNet,代码行数:29,代码来源:TextStyle.cs


示例3: TextStyleLoader

        /// <summary>
        /// Initializes a new instance of the <see cref="Common.App.ResourceTypes.Loaders.TextStyleLoader"/> class.
        /// </summary>
        /// <param name="path">Path to text style.</param>
        public TextStyleLoader(string path)
        {
            DebugEx.VerboseFormat("Created TextStyleLoader(path = {0}) object", path);

            mPath      = path;
            mTextStyle = null;
        }
开发者ID:Gris87,项目名称:UnityEditorCommonScripts,代码行数:11,代码来源:TextStyleLoader.cs


示例4: ApplyTextStyles

        protected static void ApplyTextStyles(TextElement textElement, TextStyle style)
        {
            if (style != null)
            {
                SetBinding(style, TextStyle.FontSizeProperty, () =>
                {
                    var fontSize = style.FontSize * style.FontSizeRatioValue();
                    if (fontSize > 0)
                    {
                        textElement.FontSize = fontSize;
                    }
                });

                SetBinding(style, TextStyle.FontSizeRatioProperty, () =>
                {
                    var fontSize = style.FontSize * style.FontSizeRatioValue();
                    if (fontSize > 0)
                    {
                        textElement.FontSize = fontSize;
                    }
                });

                BindingOperations.SetBinding(textElement, TextElement.FontFamilyProperty, CreateBinding(style, "FontFamily"));
                BindingOperations.SetBinding(textElement, TextElement.FontStyleProperty, CreateBinding(style, "FontStyle"));
                BindingOperations.SetBinding(textElement, TextElement.FontWeightProperty, CreateBinding(style, "FontWeight"));
                BindingOperations.SetBinding(textElement, TextElement.ForegroundProperty, CreateBinding(style, "Foreground"));
            }
        }
开发者ID:ridomin,项目名称:waslibs,代码行数:28,代码来源:HtmlWriter.cs


示例5: write

        private static void write(string text, TextStyle s)
        {
            if (s != null)
            {
                if (s.Bold)
                    Out("<b>");
                if (s.Italic)
                    Out("<i>");
                if (s.Transparent)
                    Out("<span style=\"color:" + GetHTMLColor(s.ForeColor) + "\">");
                else
                    Out("<span style=\"color:" + GetHTMLColor(s.ForeColor) + ";background-color:" +
                        GetHTMLColor(s.BackColor) + ";\">");
            }

            text = text.Replace("&", "&amp;");
            text = text.Replace("<", "&lt;");
            text = text.Replace(">", "&gt;");
            text = text.Replace(" ", "&nbsp;");
            text = text.Replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");
            Out(text);

            if (s != null)
            {
                Out("</span>");

                if (s.Italic)
                    Out("</i>");
                if (s.Bold)
                    Out("</b>");
            }
        }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:32,代码来源:SimpleHTMLExporter.cs


示例6: Column

		public Column(DataColumn col, int width)
		{
			Header = new Text();
			Style = new TextStyle();
			this.width = width;
			this.Header.Contents = this.Expression = col.ColumnName;
		}
开发者ID:elementar,项目名称:Suprifattus.Util,代码行数:7,代码来源:Column.cs


示例7: Token

		//=========================================================================================
		public Token(string typeName, string text, TextPoint start, TextPoint end, TextStyle style)
		{
			this.TokenTypeName = typeName;
			this.Text = text;
			this.Start = start;
			this.End = end;
			this.Style = style;
		}
开发者ID:ygavrishov,项目名称:SA.CodeView,代码行数:9,代码来源:Token.cs


示例8: AddPatternString

 public static void AddPatternString(string Text,Row Row,Pattern Pattern,TextStyle Style,Segment Segment,bool HasError)
 {
     Word x= Row.Add (Text);
     x.Style = Style;
     x.Pattern = Pattern;
     x.HasError =HasError;
     x.Segment =Segment;
 }
开发者ID:BradFuller,项目名称:pspplayer,代码行数:8,代码来源:ParseTools.cs


示例9: SetParagraphStyle

 public override void SetParagraphStyle(TextStyle style, TextAlign align)
 {
     _wordapp.Selection.set_Style(style.ToString());
     if (align == TextAlign.Right)
         _wordapp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphRight;
     else if (align == TextAlign.Center)
         _wordapp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;
 }
开发者ID:mokacao,项目名称:backup,代码行数:8,代码来源:WordBook.cs


示例10: InitializeStyle

        public void InitializeStyle()
        {
            library = new Font.Library();
            library.LoadUFFMemory( Resources.UberConsoleUFF, Industry.FX.Font.GreyscaleAsForecolorAlphaScaledBitmapColorTransform );

            ltgray4 = new Font( library, "Uber Console", 4 ) { Color = Color.FromArgb(unchecked((int)0x44000000u)) };
            ltblue4 = new Font( library, "Uber Console", 4 ) { Color = Color.FromArgb(unchecked((int)0x440000BBu)) };
            ltgray5 = new Font( library, "Uber Console", 5 ) { Color = Color.FromArgb(unchecked((int)0x44000000u)) };
            ltblue5 = new Font( library, "Uber Console", 5 ) { Color = Color.FromArgb(unchecked((int)0x440000BBu)) };
            gray4   = new Font( library, "Uber Console", 4 ) { Color = Color.FromArgb(unchecked((int)0x88000000u)) };
            gray5   = new Font( library, "Uber Console", 5 ) { Color = Color.FromArgb(unchecked((int)0x88000000u)) };
            blue4   = new Font( library, "Uber Console", 4 ) { Color = Color.Blue   };
            blue5   = new Font( library, "Uber Console", 5 ) { Color = Color.Blue   };
            purple  = new Font( library, "Uber Console", 5 ) { Color = Color.Purple };
            black   = new Font( library, "Uber Console", 5 ) { Color = Color.Black  };
            red4    = new Font( library, "Uber Console", 4 ) { Color = Color.FromArgb(unchecked((int)0x88FF0000u)) };
            red5    = new Font( library, "Uber Console", 5 ) { Color = Color.Red    };
            orange  = new Font( library, "Uber Console", 5 ) { Color = Color.Orange };

            semiignore = new TextStyle()
                { Timestamp = new ColumnStyle() { Font = gray4, Width = 35 }
                , Nickname  = new ColumnStyle() { Font = gray4, Width = 100, HorizontalAlignment = HorizontalAlignment.Right }
                , Message   = new MessageColumnStyle() { Font = gray4, LinkFont = ltblue4, Width = -1 }
                };
            normal = new TextStyle()
                { Timestamp = new ColumnStyle() { Font = gray4, Width = 35 }
                , Nickname  = new ColumnStyle() { Font = blue5, Width = 100, HorizontalAlignment = HorizontalAlignment.Right }
                , Message   = new MessageColumnStyle() { Font = black, LinkFont = blue5, Width = -1 }
                };
            self = new TextStyle()
                { Timestamp = new ColumnStyle() { Font = gray4 , Width = 35 }
                , Nickname  = new ColumnStyle() { Font = purple, Width = 100, HorizontalAlignment = HorizontalAlignment.Right }
                , Message   = new MessageColumnStyle() { Font = black, LinkFont = blue5, Width = -1 }
                };
            alerted = new TextStyle()
                { Timestamp = new ColumnStyle() { Font = gray4, Width = 35 }
                , Nickname  = new ColumnStyle() { Font = red5 , Width = 100, HorizontalAlignment = HorizontalAlignment.Right }
                , Message   = new MessageColumnStyle() { Font = black, LinkFont = blue5, Width = -1 }
                };
            commanderror = alerted;

            system = new TextStyle()
                { Timestamp = new ColumnStyle() { Font = gray4, Width = 35 }
                , Nickname  = new ColumnStyle() { Font = gray5, Width = 100, HorizontalAlignment = HorizontalAlignment.Right }
                , Message   = new MessageColumnStyle() { Font = gray5, LinkFont = ltblue5, Width = -1 }
                };
            smallalert = new TextStyle()
                { Timestamp = new ColumnStyle() { Font = red4, Width = 35 }
                , Nickname  = new ColumnStyle() { Font = red4, Width = 100, HorizontalAlignment = HorizontalAlignment.Right }
                , Message   = new MessageColumnStyle() { Font = red4, LinkFont = blue4, Width = -1 }
                };

            baddyalert = new TextStyle()
                { Timestamp = new ColumnStyle()        { Font = gray4 , Width = 35 }
                , Nickname  = new ColumnStyle()        { Font = orange, Width = 100, HorizontalAlignment = HorizontalAlignment.Right }
                , Message   = new MessageColumnStyle() { Font = black , LinkFont = blue5, Width = -1 }
                };
        }
开发者ID:MaulingMonkey,项目名称:uberirc,代码行数:58,代码来源:IrcView.Style.cs


示例11: AddPatternString

        //public static char[] Parse(string text,string separators)
        //{
        //    //string Result="";
        //    System.Text.StringBuilder Result=new System.Text.StringBuilder ();
        //    text= " " + text +" ";

        //    char c;

        //    for(int i = 0; i <text.Length;i++)
        //    {
        //        c = text[i];
        //        if (separators.IndexOf (c)>=0 )
        //            Result.Append (' ');
        //        else
        //            Result.Append ('.');
        //    }

        //    return Result.ToString().ToCharArray ();
        //}



        public static void AddPatternString(string text, Row row, Pattern pattern, TextStyle style, TextStyle matchingStyle, Segment segment, bool hasError)
        {
            Word x = row.Add(text);
            x.Style = style;
            x.MatchingStyle = matchingStyle;
            x.Pattern = pattern;
            x.HasError = hasError;
            x.Segment = segment;
        }
开发者ID:westybsa,项目名称:MP.LSharp,代码行数:31,代码来源:ParseTools.cs


示例12: TextString

 public TextString(string text, TextStyle style, uint size)
 {
     characterSize = size;
     if( style == TextStyle.Bold )
         Text = "<b>" + text + "</b>";
     else if( style == TextStyle.Italic )
         Text = "<i>" + text + "</i>";
     else
         Text = text;
 }
开发者ID:Ziple,项目名称:NOubliezPas,代码行数:10,代码来源:TextString.cs


示例13: Apply

        /// <summary>
        /// Apply text style to specified text component.
        /// </summary>
        /// <param name="text">Text component.</param>
        public void Apply(Text text)
        {
            DebugEx.VerboseFormat("TextStyleLoader.Apply(text = {0})", text);

            if (mTextStyle == null)
            {
                mTextStyle = AssetUtils.LoadTextStyle(mPath);
            }

            mTextStyle.Apply(text);
        }
开发者ID:Gris87,项目名称:UnityEditorCommonScripts,代码行数:15,代码来源:TextStyleLoader.cs


示例14: AddContextText

 public void AddContextText(string text, TextStyle style = TextStyle.Normal)
 {
     if (style == TextStyle.Bold)
     {
         content.Append("#" + text + "#");
     }
     else
     {
         content.Append(text);
     }
 }
开发者ID:kzemek,项目名称:FileScanner,代码行数:11,代码来源:TxtDocumentBuilder.cs


示例15: DrawText

        public static void DrawText(Graphics graphics, string text, Font font, Rectangle bounds, Color color, TextFormatFlags flags, TextStyle textStyle)
        {
            if (!VisualStyleRenderer.IsSupported) {
                TextRenderer.DrawText(graphics, text, font, bounds, color, flags);
                return;
            }

            IntPtr primaryHdc = graphics.GetHdc();

            // Create a memory DC so we can work offscreen
            IntPtr memoryHdc = CreateCompatibleDC(primaryHdc);

            // Create a device-independent bitmap and select it into our DC
            BITMAPINFO info = new BITMAPINFO();
            info.biSize = Marshal.SizeOf(info);
            info.biWidth = bounds.Width;
            info.biHeight = -bounds.Height;
            info.biPlanes = 1;
            info.biBitCount = 32;
            info.biCompression = 0; // BI_RGB
            IntPtr dib = CreateDIBSection(primaryHdc, info, 0, 0, IntPtr.Zero, 0);
            SelectObject(memoryHdc, dib);

            // Create and select font
            IntPtr fontHandle = font.ToHfont();
            SelectObject(memoryHdc, fontHandle);

            // Draw glowing text
            VisualStyleRenderer renderer = new VisualStyleRenderer(System.Windows.Forms.VisualStyles.VisualStyleElement.Window.Caption.Active);
            DTTOPTS dttOpts = new DTTOPTS();
            dttOpts.dwSize = Marshal.SizeOf(typeof(DTTOPTS));

            if (textStyle == TextStyle.Glowing) {
                dttOpts.dwFlags = DTT_COMPOSITED | DTT_GLOWSIZE | DTT_TEXTCOLOR;
            }
            else {
                dttOpts.dwFlags = DTT_COMPOSITED | DTT_TEXTCOLOR;
            }
            dttOpts.crText = ColorTranslator.ToWin32(color);
            dttOpts.iGlowSize = 8; // This is about the size Microsoft Word 2007 uses
            RECT textBounds = new RECT(0, 0, bounds.Right - bounds.Left, bounds.Bottom - bounds.Top);
            DrawThemeTextEx(renderer.Handle, memoryHdc, 0, 0, text, -1, (int)flags, ref textBounds, ref dttOpts);

            // Copy to foreground
            const int SRCCOPY = 0x00CC0020;
            BitBlt(primaryHdc, bounds.Left, bounds.Top, bounds.Width, bounds.Height, memoryHdc, 0, 0, SRCCOPY);

            // Clean up
            DeleteObject(fontHandle);
            DeleteObject(dib);
            DeleteDC(memoryHdc);

            graphics.ReleaseHdc(primaryHdc);
        }
开发者ID:kzys,项目名称:Gmail-Notifier-Plus,代码行数:54,代码来源:GlassHelper.cs


示例16: AddContextText

 public void AddContextText(string text, TextStyle style = TextStyle.Normal)
 {
     if (style == TextStyle.Bold)
     {
         contextParagraph.AddFormattedText(text, document.Styles["Bold"].Font);
     }
     else
     {
         contextParagraph.AddText(text);
     }
 }
开发者ID:kzemek,项目名称:FileScanner,代码行数:11,代码来源:PDFDocumentBuilder.cs


示例17: BasicLabel

        public BasicLabel(UIManager manager_, Widget parent_, DCFont font, TextStyle style, Color color, string str, uint size = 30 )
            : base(manager_, parent_)
        {
            Manager.RegisterWidgetType("BasicLabel", "Widget");

            myFont = font;
            myText = str;
            myTextSize = size;
            myStyle = style;
            myTextColor = color;
            updateSize();
        }
开发者ID:Ziple,项目名称:NOubliezPas,代码行数:12,代码来源:Label.cs


示例18: SimpleTable

        public SimpleTable()
        {
            this.TableStyle = new TableStyle();
            this.HeaderTextStyle = new TextStyle();
            this.HeaderTextStyle.FontWeight = FontWeight.Bold;
            this.HeaderTextStyle.FontSize = ReportDefinition.default_font_size;
            
            this.DetailTextStyle = new TextStyle();
            this.DetailTextStyle.FontSize = ReportDefinition.default_font_size;

            this.ColumnStyles = new List<TableColumnStyle>();
        }
开发者ID:saveenr,项目名称:saveenr,代码行数:12,代码来源:SimpleTable.cs


示例19: AddPatternString

 public static void AddPatternString(string Text, Row Row, Pattern Pattern,
     TextStyle Style, Span span, bool HasError)
 {
     var x = new Word
     {
         Style = Style,
         Pattern = Pattern,
         HasError = HasError,
         Span = span,
         Text = Text
     };
     Row.Add(x);
 }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:13,代码来源:ParseTools.cs


示例20: ReportDefinition

        public ReportDefinition( )
        {
            this.ReportHeaderDefinition = new ReportHeaderDefinition();
            this.ReportHeaderDefinition.ReportTitle.TextStyle.FontSize = default_font_size;

            this.ReportFooterDefinition = new ReportFooterDefinition();

            this.Table = new SimpleTable();
            this.TextStyle = new TextStyle();



        }
开发者ID:saveenr,项目名称:saveenr,代码行数:13,代码来源:ReportDefinition.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TextType类代码示例发布时间:2022-05-24
下一篇:
C# TextSpan类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap