ToString() public method

public ToString ( ) : string
return string
Beispiel #1
0
        // Toggles the bit specified in intBit in the byte given in bytByte
        public void ToggleBit(ref object bytByte, object intBit)
        {
            double BitMask;

            BitMask = Math.Pow(2, (int.Parse(intBit.ToString()) - 1));
            bytByte = int.Parse(bytByte.ToString()) ^ int.Parse(BitMask.ToString());
        }
Beispiel #2
0
        // Returns true if the bit specified in intBit is true, false if not.
        public bool ExamineBit(byte bytToCheck, int intBit)
        {
            double BitMask;

            BitMask = Math.Pow(2, (intBit - 1));
            return((bytToCheck & byte.Parse(BitMask.ToString())) > 0);
        }
Beispiel #3
0
        public Task Start(IDictionary <string, List <string> > args)
        {
            try
            {
                var bm  = new BitMask(156);
                var bm3 = new BitMask(56);

                bm[3]   = true;
                bm[34]  = true;
                bm[134] = true;
                bm3[2]  = true;

                var T  = bm.GetTiles();
                var s1 = bm.ToBinaryString();
                var s2 = bm.ToUintString();
                var s3 = bm.ToString();
                var s4 = bm3.ToString();


                var bm2 = new BitMask(T, bm.Count);
                bm.Or(bm2);

                Passed     = true;
                IsComplete = true;
            }
            catch (Exception ex)
            {
                Passed         = false;
                FailureMessage = ex.Message;
            }

            return(Task.CompletedTask);
        }
Beispiel #4
0
        // Clears the bit specified in intBit in the byte given in bytByte
        public void ClearBit(ref byte bytByte, int intBit)
        {
            double BitMask;

            BitMask = Math.Pow(2, (intBit - 1));
            int intByte = ~int.Parse(BitMask.ToString());

            bytByte = byte.Parse(intByte.ToString());
        }
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString("Scale", Scale.ToString());
     writer.WriteElementString("Offset", Offset.ToString());
     writer.WriteElementString("BitMask", BitMask.ToString());
 }