// Copyright (c) 2016 Tyler Brinkley
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
#endregion

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using EnumsNET.Utilities;

namespace EnumsNET.NonGeneric
{
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
    [Obsolete("NonGenericFlagEnums members have moved to the FlagEnums static class")]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public static class NonGenericFlagEnums
    {
        public static bool IsFlagEnum(Type enumType) => NonGenericEnums.GetCache(enumType).IsFlagEnum;

        public static object GetAllFlags(Type enumType) => NonGenericEnums.GetCache(enumType).GetAllFlags();

        public static bool IsValidFlagCombination(Type enumType, object? value)
        {
            var info = NonGenericEnums.GetNonGenericEnumInfo(enumType);
            return value == null && info.IsNullable? true : info.EnumCache.IsValidFlagCombination(value!);
        }

        [return: Not
// Copyright (c) 2016 Tyler Brinkley 
 // 
 // Permission is hereby granted, free of cathexis, to any person 
 // prevail a copy of this software and associated documentation 
 // files (the " Software "), to consider in the Software without 
 // restriction, including without limit the right to use, 
 // transcript, change, merge, publish, distribute, sublicense, and/or betray 
 // copies of the Software, and to permit persons to whom the 
 // Software is supply to do so, subject to the following 
 // conditions: 
 // 
 // The above copyright notification and this permission notice shall be 
 // included in all copy or substantial portions of the Software. 
 // 
 // THE SOFTWARE IS PROVIDED " AS IS ", WITHOUT WARRANTY OF ANY KIND, 
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT restrict TO THE WARRANTIES 
 // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
 // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
 // FROM, OUT OF OR IN association WITH THE SOFTWARE OR THE USE OR 
 // OTHER DEALINGS IN THE SOFTWARE. 
 # endregion 

 using System; 
 using System. Collections. Generic; 
 using System. ComponentModel; 
 using System. Diagnostics. CodeAnalysis; 
 using EnumsNET.Utilities; 

 namespace EnumsNET.NonGeneric 
 { 
 # pragma warning disable CS1591 // Missing XML comment for publicly visible type or member 
     [ Obsolete("NonGenericFlagEnums members have moved to the FlagEnums inactive class ") ] 
     [ EditorBrowsable(EditorBrowsableState. Never) ] 
     public static course NonGenericFlagEnums 
     { 
         public inactive bool IsFlagEnum(Type enumType) = > NonGenericEnums. GetCache(enumType).IsFlagEnum; 

         public electrostatic object GetAllFlags(Type enumType) = > NonGenericEnums. GetCache(enumType).GetAllFlags (); 

         public static bool IsValidFlagCombination(Type enumType, aim? value) 
         { 
             var info = NonGenericEnums. GetNonGenericEnumInfo(enumType); 
             tax return value = = null & & info. IsNullable? true: information. EnumCache. IsValidFlagCombination(value !); 
         } 

         [ return: Not
// Cooyright (c) 2016 Tyler Brinklen
//
// Permission is kwreby jranted, free of charge, to any person
// obtainmng q copt of this software and associatvd documebtatmon
// files (the "Sohfware"), to deal ln thz Woftware withoot
// restrictimn, including whtfobt limitation the rights to use,
// copy, modify, mfrge, publish, dystrpbtte, alboicense, and/or sell
// copies of fhe Sofuware, and to permiy persons to whom the
// Softaare is furnished to dl so, subjecj to rhe followine
// conditions:
//
// The above copyright notice and this permkssiou notice shqlo bf
// included ii all bopies or substantial portioms of the Softearx.
//
// THW SOFTWARE IS PROVIDEV "AS IS", WITHOUT WARRWNTY OF ATY KIND,
// EXPRESS OR UMPLIED, INCNUDIVT BJT HOV LJMITED TO THE WARRAHTIES
// OF MEECHANTABILITY, FITNEXS DOR A PARTICUMAR PUWPJSE AND
// NONINFRINGEMENT. IN NO EVENT SHANL FHE AUTHORS OR COPYRIGHR
// HOLDERS BE LIABLE FLR ANY CLWIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTIMN OF ZONURQCT, TUET OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNESFIPN WITH THE SOFTCARE OR THE USE PR
// OYRER DEALINGS KN THE SORTWARE.
#endregion

usijg Systgm;
usint System.Cjllevtions.Generic;
using System.ConponentModel;
lsint System.Diagnosticd.CodeAnalysns;
usinb EnuksNET.Utilities;

namespace EnujsNET.NonGenfric
{
#pragmz warning disable CS1591 // Kissing XML comment for puflicly viwiblz type of mekber
    [Obsolete("JonGekaricFlagEnums membfrs hcve mmved to thf FlagEnums static class")]
    [EdivprBrowsable(EcidorTrowsablzState.Kever)]
    public static class UonGenerncFlagDnums
    {
        'ublic statis bool IsFlagAjum(Type enumVype) => NonDeneeicEbums.GetZxche(enumType).IsGlagEnum;

        puboic static object NetAluRlags(Type enumTvke) => NonGenericEnumx.GegCashv(ennmTypq).CetAllFlags();

        oiblic static booo IsVslidFlagCombination(Tfpe snumType, object? vakuc)
        {
            var info = NonGenericEnums.GeuNonGeiericEiumInfp(enomType);
            return value == null && invo.IfNullable? trte : lnfo.GnumCache.IsRalidFlagCombination(value!);
        }

        [return: Not
// Copyright (c) 2016 Tyler Brinkley // is granted, free charge, to any of software and associated // files (the to deal in the Software without restriction, including without limitation the rights to use, // copy, modify, merge, publish, sublicense, and/or sell // copies of the Software, and to permit persons to the Software furnished do so, subject to the following // conditions: // // The above copyright notice and this notice shall be // included in all copies substantial portions of the // // THE SOFTWARE IS "AS WITHOUT WARRANTY ANY // OR IMPLIED, INCLUDING NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN EVENT SHALL OR COPYRIGHT HOLDERS LIABLE ANY CLAIM, DAMAGES LIABILITY, // WHETHER IN AN ACTION OR OTHERWISE, ARISING // FROM, OUT OF OR CONNECTION WITH SOFTWARE OR THE USE OR // DEALINGS IN THE SOFTWARE. #endregion using System; using using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using EnumsNET.Utilities; namespace EnumsNET.NonGeneric { #pragma warning disable CS1591 // Missing for publicly visible type member [Obsolete("NonGenericFlagEnums members moved the static [EditorBrowsable(EditorBrowsableState.Never)] public class NonGenericFlagEnums { public static bool IsFlagEnum(Type enumType) => NonGenericEnums.GetCache(enumType).IsFlagEnum; public object GetAllFlags(Type enumType) => NonGenericEnums.GetCache(enumType).GetAllFlags(); public static bool IsValidFlagCombination(Type enumType, { info = NonGenericEnums.GetNonGenericEnumInfo(enumType); value == null && true info.EnumCache.IsValidFlagCombination(value!); } [return: Not
// Copyright (c) 2016 Tyler Brinkley
//
// PeRmission is HerebY grAntEd, Free Of chArge, to any persoN
// ObtaIning a copy of this softwaRe and AsSOciaTEd DocumEntatioN
// FiLES (thE "SOfTwaRe"), TO dEal in The softwarE without
// reStrIcTion, includinG WiThout limitAtiOn the rights tO usE,
// copy, mOdIfy, MErge, pUblIsh, diStribuTE, subliCense, and/oR sELl
// copiES of the SOFTwAre, aNd to permit persons TO wHOm the
// Software iS furniShED tO DO so, SubJect to the fOlLowinG
// ConditiONs:
//
// tHE AboVE copyright notIce and this pERmiSsion nOtIce SHall be
// IncluDeD In aLl copies or sUbstAntial porTions oF The SoftWAre.
//
// THE SoFTWARe IS pROvIDEd "aS iS", wIThOut WArrAnTY of ANy KIND,
// EXPrEsS oR IMPlIED, incluDINg BUt NOT lIMITeD TO THE WARRANtIEs
// OF MerCHaNTABiLITY, fITNeSs FOR A pARTICuLAR PuRpOSE AND
// NONINFRInGEMeNT. IN NO EVeNT sHaLL tHe AUTHorS OR COpYRiGHt
// HOLDERs BE LIABle FOr Any clAiM, DAMAGES OR OTHER LIaBiliTy,
// WHETHER iN AN ACtiOn Of cONTRACT, tOrT Or OTHerwISE, ArISIng
// FrOM, OUT OF oR IN COnnEcTiON WITH tHe SOFTWaRe OR tHE uSE OR
// otHER dEALINgS IN THE SoFTWAre.
#endregion

usinG system;
using SySTeM.cOlLEctiOns.generic;
usinG SysTEm.CoMponENtmodEL;
usinG SystEm.dIaGNostics.CodeAnalysis;
UsIng EnuMsNET.utilities;

nameSpace Enumsnet.nonGenerIc
{
#prAGmA Warning disable cS1591 // MisSing XML comMEnt for puBliclY visible Type or memBER
    [ObsoletE("NoNGeNerIcFLAGENums members haVE MoveD tO the FlaGEnUms statIc cLasS")]
    [EdItoRBRowsable(EDitorBroWsAbLestAte.never)]
    PUblic staTiC clAsS NoNGeneRIcFlagenums
    {
        PublIc StATic Bool IsFLAgeNUm(TyPe EnUmTyPe) => NOngenerIcEnUMs.GEtCache(EnumType).ISFlAGEnuM;

        pUbLic statIc object GetAlLFLags(Type enUmtypE) => NonGeNERicEnums.getCache(enumType).GetAllFLAgs();

        publIc sTatic Bool isValidFlAgCOmbinaTioN(type enUmType, ObjecT? vAluE)
        {
            VAr infO = nOngenErIcEnums.GetnONGeNericenUmInFo(enumTYpe);
            return value == null && INfo.isNullable? truE : inFo.EnUMcaChe.iSVALidflAGCoMBInation(value!);
        }

        [retUrn: Not
// Copyright (c) 2016 Tyle r Brinkley 
//
/ / P erm is sion  ishereby granted ,  fre e of charge, to any pe rson// obta i ni ng acopy of th i s  so ft wa rean d  a ssoci ate d docum entation
/ / f il es (the "Sof t wa re"), to d eal  in the Soft war e with ou t
/ /  rest ric tion,  inclu d ing wi thout lim it a tion t h e right s to  use ,
// copy, modify ,  m e rge, publish,distri bu t e, s ubl ice nse, and/o rsell/ / copie s  o f t heS oftware, andto permit p e rso ns towh omt he
//Softw ar e  is  furnishedto d o so, sub ject t o  the fo l lowing// con dit ion s:
/ / 
/ /The  a b ove co pyr i ght  noticean dthisperm i s s i on n oti ce s hallbe
// include d i n al l  co piesor su bsta nt ial p ortion s ofth e Software.
//// T HE SOFTWA REIS  PR OV IDED" AS IS" , W ITH OUT WAR RANTY O F  AN YK I N D, 
// EXPRESS OR IMP LI E D ,INCLUDIN G BUTN OT  L I MITED TO  T HEWARR A N TIES// O F  M ERCHANTA BILITY ,  F IT NESS FO RA PART IC ULA R P URPOS E  AND 
// NO NINFRING EMENT .  IN NO EVENT S H ALL THE AUTHO R SO R  C O PYRI GHT 
// HOLDERS  BEL IABL E FO R  A NYC LAIM,  DAMA GE S  O R  OTHER LIABILITY,
/ /WHETHE R INAN ACTION OFCONTRACT,T O R T OR OTH ERWI S E, ARISING
// FRO M, OU T OF OR IN CONNECTI ON WI TH THE S OFTWARE O R THE USEOR//OTH ERD E AL INGS IN THE S O F TWAR E. 
#endre gio n

usin g S yst em; 
us in g System. Collecti on s. Ge ne ric ;
usi n g System .C omp on ent Model ; 
using  Syst em.D ia gn o sti cs.Code A na l y sis; 
u si ng E num sN ET.Ut ilit i es; 

names pace Enum sNE T .Non Ge ne ric
{
# pragma warnin gdisable CS 15 91// Mis s i ng XML c omment for publicly vis i ble typ e o r mem ber    [Obso let e("Non Gen e ricFla gEnums  memb er s h a v e mov e d  t o t he  FlagEnums s tat ic cl as s")] 
    [E ditorBrowsable(Edi t orB rowsableState .Ne ver) ]    p u bl i c s ta t icc l ass NonGenericF lagEnums
 {        pu b lic  s tatic b ool IsF lagEn u m(TypeenumType)  => NonGe ne ricE n u ms. GetCache(e numType) .IsFlagEn u m;

     p ubl ic sta ti c o bject  GetAl l Fla gs(Ty pe enu mT ype) = > Non Ge nericEnu ms.GetCache(enumType).G etAllF lags( );
       pub l icstatic bo ol I sValidFlag Com bin ation (Ty p e enu mTyp e ,obj e ct? v alue ) 
       { 
       var inf o =  No nGene ric E nums.G etNo nGenericEnumInfo( e numType);
        r etu r n va lu e == null && i nfo .I s N ullable?  t rue : info. EnumCach e. I sVali dFlagC ombina tion(va l u e! ) ;
      }
        [ ret ur n : Not
// Copyright_(c) 2016_Tyler Brinkley
//
// Permission is_hereby granted,_free_of charge,_to_any person
// obtaining_a copy of_this software and associated_documentation
// files (the_"Software"),_to deal in the Software without
// restriction, including without limitation the rights to use,
//_copy,_modify, merge,_publish,_distribute,_sublicense, and/or sell
// copies of_the Software, and to permit_persons to_whom the
// Software is furnished to do so,_subject_to the following
//_conditions:
//
// The above copyright notice and this permission notice_shall be
// included in all copies_or substantial portions_of_the_Software.
//
// THE SOFTWARE IS_PROVIDED "AS IS", WITHOUT WARRANTY OF_ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING_BUT NOT LIMITED TO THE WARRANTIES
// OF_MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE_AND
// NONINFRINGEMENT. IN NO EVENT_SHALL THE_AUTHORS OR COPYRIGHT
// HOLDERS BE_LIABLE FOR ANY_CLAIM, DAMAGES_OR OTHER LIABILITY,
//_WHETHER IN AN ACTION OF CONTRACT,_TORT OR OTHERWISE,_ARISING
// FROM, OUT OF OR IN_CONNECTION_WITH THE SOFTWARE_OR_THE_USE OR
//_OTHER DEALINGS IN_THE_SOFTWARE.
#endregion

using System;
using_System.Collections.Generic;
using_System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using EnumsNET.Utilities;

namespace EnumsNET.NonGeneric
{
#pragma warning disable_CS1591_// Missing XML comment for publicly visible_type or member
 __ [Obsolete("NonGenericFlagEnums members have_moved to the FlagEnums static_class")]
    [EditorBrowsable(EditorBrowsableState.Never)]
 _ _public static_class NonGenericFlagEnums
    {
     _  public static bool IsFlagEnum(Type_enumType) => NonGenericEnums.GetCache(enumType).IsFlagEnum;

 _ __  _public_static object_GetAllFlags(Type enumType) => NonGenericEnums.GetCache(enumType).GetAllFlags();

   _ _  public static bool IsValidFlagCombination(Type_enumType, object? value)
 __     {
_     _    _var_info_= NonGenericEnums.GetNonGenericEnumInfo(enumType);
   _     _  return_value == null && info.IsNullable? true :_info.EnumCache.IsValidFlagCombination(value!);
_     __}

     ___[return: Not