Skip to content

Instantly share code, notes, and snippets.

@pfrozi
Created June 22, 2021 16:37
Show Gist options
  • Select an option

  • Save pfrozi/edaf8429e1d7c6524c82c453853dee2d to your computer and use it in GitHub Desktop.

Select an option

Save pfrozi/edaf8429e1d7c6524c82c453853dee2d to your computer and use it in GitHub Desktop.

Revisions

  1. pfrozi created this gist Jun 22, 2021.
    20 changes: 20 additions & 0 deletions TestFlags.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    using System;

    public class Program
    {
    public static void Main()
    {
    var e = Teste.Cliente | Teste.Documentos;
    Console.WriteLine(e.HasFlag(Teste.Cliente));
    Console.WriteLine(e.HasFlag(Teste.Liberacoes));
    Console.WriteLine(e.HasFlag(Teste.Documentos));
    }

    [Flags]
    public enum Teste
    {
    Cliente = 1 << 0,
    Liberacoes = 1 << 1,
    Documentos = 1 << 2,
    }
    }