Beispiel #1
0
        private bool GetFlag(BoolMemberBits flagBit)
        {
            EnsureReflector();
            bool?result = _reflector.GetFlag(flagBit);

            if (!result.HasValue)
            {
                result = LookupBooleanValue(flagBit);
                _reflector.SetFlag(flagBit, result.Value);
            }
            return(result.Value);
        }
        private bool GetFlag(BoolMemberBits flagBit)
        {
            this.EnsureReflector();
            bool?flag = this._reflector.GetFlag(flagBit);

            if (!flag.HasValue)
            {
                flag = new bool?(this.LookupBooleanValue(flagBit));
                this._reflector.SetFlag(flagBit, flag.Value);
            }
            return(flag.Value);
        }
Beispiel #3
0
        private bool LookupBooleanValue(BoolMemberBits flag)
        {
            bool result;

            switch (flag)
            {
            case BoolMemberBits.Ambient:
                result = LookupIsAmbient();
                break;

            case BoolMemberBits.Event:
                result = LookupIsEvent();
                break;

            case BoolMemberBits.ReadOnly:
                result = LookupIsReadOnly();
                break;

            case BoolMemberBits.ReadPublic:
                result = LookupIsReadPublic();
                break;

            case BoolMemberBits.WriteOnly:
                result = LookupIsWriteOnly();
                break;

            case BoolMemberBits.WritePublic:
                result = LookupIsWritePublic();
                break;

            default:
                Debug.Fail("Enum out of range");
                result = GetDefaultFlag(flag);
                break;
            }
            return(result);
        }
        private bool LookupBooleanValue(BoolMemberBits flag)
        {
            switch (flag)
            {
            case BoolMemberBits.ReadPublic:
                return(this.LookupIsReadPublic());

            case BoolMemberBits.WritePublic:
                return(this.LookupIsWritePublic());

            case BoolMemberBits.ReadOnly:
                return(this.LookupIsReadOnly());

            case BoolMemberBits.WriteOnly:
                return(this.LookupIsWriteOnly());

            case BoolMemberBits.Event:
                return(this.LookupIsEvent());

            case BoolMemberBits.Ambient:
                return(this.LookupIsAmbient());
            }
            return(GetDefaultFlag(flag));
        }
 internal void SetFlag(BoolMemberBits flag, bool value)
 {
     SetFlag(ref _memberBits, (int)flag, value);
 }
 internal bool?GetFlag(BoolMemberBits flag)
 {
     return(GetFlag(_memberBits, (int)flag));
 }
Beispiel #7
0
 private static bool GetDefaultFlag(BoolMemberBits flagBit)
 {
     return((BoolMemberBits.Default & flagBit) == flagBit);
 }
 internal bool? GetFlag(BoolMemberBits flag)
 {
     return Reflector.GetFlag(this._memberBits, (int) flag);
 }
 internal void SetFlag(BoolMemberBits flag, bool value)
 {
     Reflector.SetFlag(ref this._memberBits, (int) flag, value);
 }
 internal bool?GetFlag(BoolMemberBits flag)
 {
     return(Reflector.GetFlag(this._memberBits, (int)flag));
 }
 internal void SetFlag(BoolMemberBits flag, bool value)
 {
     Reflector.SetFlag(ref this._memberBits, (int)flag, value);
 }