System.Runtime.Serialization.CodeGenerator.Not C# (CSharp) Method

Not() private method

private Not ( ) : void
return void
        internal void Not()
        {
            if (_codeGenTrace != CodeGenTrace.None)
                EmitSourceInstruction("Not");
            _ilGen.Emit(OpCodes.Not);
        }

Usage Example

コード例 #1
0
        public void Store(int bitIndex, bool value)
        {
            LocalBuilder local    = _locals[GetByteIndex(bitIndex)];
            byte         bitValue = GetBitValue(bitIndex);

            if (value)
            {
                _ilg.Load(local);
                _ilg.Load(bitValue);
                _ilg.Or();
                _ilg.Stloc(local);
            }
            else
            {
                _ilg.Load(local);
                _ilg.Load(bitValue);
                _ilg.Not();
                _ilg.And();
                _ilg.Stloc(local);
            }
        }