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


C# Glyph类代码示例

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


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

示例1: PreviewChanges

 public Solution PreviewChanges(
     string title,
     string helpString,
     string description,
     string topLevelName,
     Glyph topLevelGlyph,
     Solution newSolution,
     Solution oldSolution,
     bool showCheckBoxes = true)
 {
     var engine = new PreviewEngine(
         title,
         helpString,
         description,
         topLevelName,
         topLevelGlyph,
         newSolution,
         oldSolution,
         _componentModel,
         _imageService,
         showCheckBoxes);
     _previewChanges.PreviewChanges(engine);
     engine.CloseWorkspace();
     return engine.FinalSolution;
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:25,代码来源:PreviewService.cs

示例2: FileSystemCompletionHelper

        public FileSystemCompletionHelper(
            CompletionListProvider completionProvider,
            TextSpan textChangeSpan,
            ICurrentWorkingDirectoryDiscoveryService fileSystemDiscoveryService,
            Glyph folderGlyph,
            Glyph fileGlyph,
            ImmutableArray<string> searchPaths,
            IEnumerable<string> allowableExtensions,
            Func<string, bool> exclude = null,
            CompletionItemRules itemRules = null)
        {
            Debug.Assert(searchPaths.All(path => PathUtilities.IsAbsolute(path)));

            _completionProvider = completionProvider;
            _textChangeSpan = textChangeSpan;
            _searchPaths = searchPaths;
            _allowableExtensions = allowableExtensions.Select(e => e.ToLowerInvariant()).ToSet();
            _fileSystemDiscoveryService = fileSystemDiscoveryService;
            _folderGlyph = folderGlyph;
            _fileGlyph = fileGlyph;
            _exclude = exclude;
            _itemRules = itemRules;

            _lazyGetDrives = new Lazy<string[]>(() =>
                IOUtilities.PerformIO(Directory.GetLogicalDrives, SpecializedCollections.EmptyArray<string>()));
        }
开发者ID:noahstein,项目名称:roslyn,代码行数:26,代码来源:FileSystemCompletionHelper.cs

示例3: SymbolCompletionItem

 public SymbolCompletionItem(
     CompletionListProvider completionProvider,
     string displayText,
     string insertionText,
     string filterText,
     TextSpan filterSpan,
     int position,
     List<ISymbol> symbols,
     string sortText,
     AbstractSyntaxContext context,
     Glyph glyph,
     bool preselect = false,
     SupportedPlatformData supportedPlatforms = null,
     CompletionItemRules rules = null)
 : base(completionProvider, displayText, filterSpan,
    descriptionFactory: null, glyph: glyph,
    sortText: sortText, filterText: filterText, preselect: preselect, showsWarningIcon: supportedPlatforms != null, rules: rules,
    filters: GetFilters(symbols))
 {
     this.InsertionText = insertionText;
     this.Position = position;
     this.Symbols = symbols;
     this.Context = context;
     _supportedPlatforms = supportedPlatforms;
 }
开发者ID:Eyas,项目名称:roslyn,代码行数:25,代码来源:SymbolCompletionItem.cs

示例4: Create

        public static CompletionItem Create(
            string displayText,
            TextSpan span,
            Glyph? glyph,
            DeclarationModifiers modifiers,
            int line,
            ISymbol symbol,
            SyntaxToken token,
            int descriptionPosition,
            CompletionItemRules rules)
        {
            var props = ImmutableDictionary<string, string>.Empty
                .Add("Line", line.ToString())
                .Add("Modifiers", modifiers.ToString())
                .Add("TokenSpanEnd", token.Span.End.ToString());

            return SymbolCompletionItem.Create(
                displayText: displayText,
                span: span,
                symbol: symbol,
                glyph: glyph,
                descriptionPosition: descriptionPosition,
                properties: props,
                rules: rules);
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:25,代码来源:MemberInsertingCompletionItem.cs

示例5: Rasterize

		public Bitmap Rasterize(Glyph glyph, TextQuality quality)
		{
			EnsureSurfaceSize(ref glyph_surface, ref glyph_renderer, glyph.Font);
			SetTextRenderingOptions(glyph_renderer, glyph.Font, quality);

			RectangleF r2 = new RectangleF();

			glyph_renderer.Clear(Color.Transparent);

			glyph_renderer.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, Point.Empty,  //new Point(glyph_surface.Width, 0),
				glyph.Font.Style == FontStyle.Italic ? load_glyph_string_format : load_glyph_string_format_tight);

			r2 = FindEdges(glyph_surface, true);

			//if ((default_string_format.FormatFlags & StringFormatFlags.DirectionRightToLeft) != 0)
			//{
			//    glyph_renderer.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, Point.Empty, //new Point(glyph_surface.Width, 0),
			//        load_glyph_string_format);//glyph.Font.Style == FontStyle.Italic ? load_glyph_string_format : default_string_format);

			//    r2 = FindEdges(glyph_surface, true);
			//}
			//else
			//{
			//    glyph_renderer.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, Point.Empty,
			//        load_glyph_string_format_tight); //glyph.Font.Style == FontStyle.Italic ? load_glyph_string_format : default_string_format);

			//    r2 = FindEdges(glyph_surface, false);
			//}

			return glyph_surface.Clone(r2, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
		}
开发者ID:treytomes,项目名称:ASCIIWorld2,代码行数:31,代码来源:GdiPlusGlyphRasterizer.cs

示例6: Crop

        public static void Crop(Glyph glyph)
        {
            // Crop the top.
            while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, glyph.Subrect.Width, 1)))
            {
                glyph.Subrect.Y++;
                glyph.Subrect.Height--;

                glyph.YOffset++;
            }

            // Crop the bottom.
            while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Bottom - 1, glyph.Subrect.Width, 1)))
            {
                glyph.Subrect.Height--;
            }

            // Crop the left.
            while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
            {
                glyph.Subrect.X++;
                glyph.Subrect.Width--;

                glyph.XOffset++;
            }

            // Crop the right.
            while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.Right - 1, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
            {
                glyph.Subrect.Width--;
            }
        }
开发者ID:cg123,项目名称:xenko,代码行数:32,代码来源:GlyphCropper.cs

示例7: PreviewEngine

 public PreviewEngine(
     string title,
     string helpString,
     string description,
     string topLevelItemName,
     Glyph topLevelGlyph,
     Solution newSolution,
     Solution oldSolution,
     IComponentModel componentModel,
     IVsImageService2 imageService,
     bool showCheckBoxes = true)
 {
     _topLevelName = topLevelItemName;
     _topLevelGlyph = topLevelGlyph;
     _title = title;
     _helpString = helpString;
     _description = description;
     _newSolution = newSolution.WithMergedLinkedFileChangesAsync(oldSolution, cancellationToken: CancellationToken.None).Result;
     _oldSolution = oldSolution;
     _diffSelector = componentModel.GetService<ITextDifferencingSelectorService>();
     _editorFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
     _componentModel = componentModel;
     this.ShowCheckBoxes = showCheckBoxes;
     _imageService = imageService;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:25,代码来源:PreviewEngine.cs

示例8: SymbolGlyphDeferredContent

        public SymbolGlyphDeferredContent(Glyph glyph, IGlyphService glyphService)
        {
            Contract.ThrowIfNull(glyphService);

            _glyph = glyph;
            _glyphService = glyphService;
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:SymbolGlyphDeferredContent.cs

示例9: Create

 public static CompletionItem Create(
     string displayText,
     ISymbol symbol,
     int contextPosition = -1,
     string sortText = null,
     string insertionText = null,
     Glyph? glyph = null,
     string filterText = null,
     int? matchPriority = null,
     SupportedPlatformData supportedPlatforms = null,
     ImmutableDictionary<string, string> properties = null,
     CompletionItemRules rules = null)
 {
     return Create(
         displayText: displayText,
         symbols: ImmutableArray.Create(symbol),
         contextPosition: contextPosition,
         sortText: sortText,
         insertionText: insertionText,
         glyph: glyph,
         filterText: filterText,
         matchPriority: matchPriority.GetValueOrDefault(),
         supportedPlatforms: supportedPlatforms,
         properties: properties,
         rules: rules);
 }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:26,代码来源:SymbolCompletionItem.cs

示例10: Create

 public static CompletionItem Create(
     string displayText,
     TextSpan span,
     ISymbol symbol,
     int contextPosition = -1,
     int descriptionPosition = -1,
     string sortText = null,
     string insertionText = null,
     Glyph? glyph = null,
     string filterText = null,
     bool preselect = false,
     SupportedPlatformData supportedPlatforms = null,
     bool isArgumentName = false,
     ImmutableDictionary<string, string> properties = null,
     CompletionItemRules rules = null)
 {
     return Create(
         displayText: displayText,
         span: span,
         symbols: ImmutableArray.Create(symbol),
         contextPosition: contextPosition,
         descriptionPosition: descriptionPosition,
         sortText: sortText,
         insertionText: insertionText,
         glyph: glyph,
         filterText: filterText,
         preselect: preselect,
         supportedPlatforms: supportedPlatforms,
         isArgumentName: isArgumentName,
         properties: properties,
         rules: rules);
 }
开发者ID:RoryVL,项目名称:roslyn,代码行数:32,代码来源:SymbolCompletionItem.cs

示例11: ReadGlyph

        /// <summary>
        ///     Reads a glyph description from the specified offset.
        /// </summary>
        public Glyph ReadGlyph(int glyphIndex) {
            FontFileStream stream = reader.Stream;

            // Offset from beginning of font file
            uint fileOffset = glyfEntry.Offset + loca[glyphIndex];
            long length = GetGlyphLength(glyphIndex);

            Glyph glyph = new Glyph(reader.IndexMappings.Map(glyphIndex));
            if (length != 0) {
                byte[] glyphData = new byte[length];

                // Read glyph description into byte array
                stream.Position = fileOffset;
                stream.Read(glyphData, 0, glyphData.Length);

                glyph.SetGlyphData(glyphData);

                FontFileStream glyphStream = new FontFileStream(glyphData);

                // This fields dictates whether the glyph is a simple or composite glyph
                bool compositeGlyph = (glyphStream.ReadShort() < 0);

                // Skip font bounding box
                glyphStream.Skip(PrimitiveSizes.Short*4);

                if (compositeGlyph) {
                    ReadCompositeGlyph(glyphStream, glyph);
                }
            }

            return glyph;
        }
开发者ID:nholik,项目名称:Fo.Net,代码行数:35,代码来源:GlyphReader.cs

示例12: RenderGlyph

		public static Surface RenderGlyph (Fnt font, Glyph g, byte[] palette, int offset)
		{
			byte[] buf = new byte[g.Width * g.Height * 4];
			int i = 0;

			for (int y = g.Height - 1; y >= 0; y--) {
				for (int x = g.Width - 1; x >= 0; x--) {
					if (g.Bitmap[y,x] == 0)
						buf [i + 0] = 0;
					else if (g.Bitmap[y,x] == 1)
						buf [i + 0] = 255;
					else
						buf [i + 0] = 128;

					buf[i + 1] = palette[ (g.Bitmap[y,x] + offset) * 3 + 2];
					buf[i + 2] = palette[ (g.Bitmap[y,x] + offset) * 3 + 1];
					buf[i + 3] = palette[ (g.Bitmap[y,x] + offset) * 3 ];

					if (buf[i+1] == 252 && buf[i+2] == 0 && buf[i+3] == 252)
						buf[i + 0] = 0;

					i += 4;
				}
			}

			return CreateSurfaceFromRGBAData (buf, (ushort)g.Width, (ushort)g.Height, 32, g.Width * 4);
		}
开发者ID:carriercomm,项目名称:scsharp,代码行数:27,代码来源:GuiUtil.cs

示例13: CSharpCompletionItem

        public CSharpCompletionItem(
            Workspace workspace,
            CompletionListProvider completionProvider,
            string displayText,
            TextSpan filterSpan,
            Func<CancellationToken, Task<ImmutableArray<SymbolDisplayPart>>> descriptionFactory,
            Glyph? glyph,
            string sortText = null,
            string filterText = null,
            bool preselect = false,
            bool isBuilder = false,
            bool showsWarningIcon = false,
            bool shouldFormatOnCommit = false)
            : base(completionProvider,
                   displayText,
                   filterSpan,
                   descriptionFactory,
                   glyph,
                   sortText,
                   filterText,
                   preselect,
                   isBuilder,
                   showsWarningIcon,
                   shouldFormatOnCommit)
        {
            Contract.ThrowIfNull(workspace);

            this.Workspace = workspace;
        }
开发者ID:CarbonBasedDudeform,项目名称:roslyn,代码行数:29,代码来源:CSharpCompletionItem.cs

示例14: QuickInfoModel

 private QuickInfoModel(SemanticModel semanticModel, TextSpan span, Glyph glyph, SymbolMarkup markup, string documentation)
 {
     SemanticModel = semanticModel;
     Span = span;
     Glyph = glyph;
     Markup = markup;
     Documentation = documentation;
 }
开发者ID:tgjones,项目名称:HlslTools,代码行数:8,代码来源:QuickInfoModel.cs

示例15: EditorNavigationTarget

 public EditorNavigationTarget(string name, SnapshotSpan span, SnapshotSpan seek, Glyph icon, ImageSource glyph)
 {
     Name = name;
     Span = span;
     Seek = seek;
     Icon = icon;
     Glyph = glyph;
 }
开发者ID:tgjones,项目名称:HlslTools,代码行数:8,代码来源:EditorNavigationTarget.cs


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