Example #1
0
        public DHCPv4ScopeAddressProperties(
            IPv4Address start,
            IPv4Address end,
            IEnumerable <IPv4Address> excluded,
            TimeSpan?renewalTime           = null,
            TimeSpan?preferredLifetime     = null,
            TimeSpan?leaseTime             = null,
            Byte?maskLength                = null,
            Boolean?reuseAddressIfPossible = null,
            AddressAllocationStrategies?addressAllocationStrategy = null,
            Boolean?supportDirectUnicast = null,
            Boolean?acceptDecline        = null,
            Boolean?informsAreAllowd     = null
            ) : base(start, end, excluded, reuseAddressIfPossible, addressAllocationStrategy, supportDirectUnicast, acceptDecline, informsAreAllowd)
        {
            Mask = (maskLength == null || maskLength == 0) ? null : new IPv4SubnetMask(new IPv4SubnetMaskIdentifier(maskLength.Value));

            RenewalTime       = renewalTime;
            PreferredLifetime = preferredLifetime;
            LeaseTime         = leaseTime;

            if (leaseTime.HasValue || renewalTime.HasValue || preferredLifetime.HasValue)
            {
                UseDynamicRewnewTime = false;
            }
        }
Example #2
0
        public void TestUInt32ToByteOrDefault()
        {
            // Test conversion of source type minimum value
            UInt32 source = UInt32.MinValue;

            Assert.IsInstanceOfType(source, typeof(UInt32));
            Byte?result = source.ToByteOrDefault((byte)86);

            Assert.AreEqual((byte)0, result);
            Assert.IsInstanceOfType(result, typeof(Byte));
            // Test conversion of source type value 42 to target type
            source = 42u;
            Assert.IsInstanceOfType(source, typeof(UInt32));
            result = source.ToByteOrDefault((byte)86);
            Assert.AreEqual((byte)42, result);
            Assert.IsInstanceOfType(result, typeof(Byte));

            // Test conversion of source type maximum value
            source = UInt32.MaxValue;
            Assert.IsInstanceOfType(source, typeof(UInt32));
            result = source.ToByteOrDefault((byte)86);
            // Here we would expect this conversion to fail (and return the default value of (byte)86),
            // since the source type's maximum value (4294967295) is greater than the target type's maximum value (255).
            Assert.AreEqual((byte)86, result);
            Assert.IsInstanceOfType(result, typeof(Byte));
        }
        public async Task <ServiceResult <Posicao> > Get(
            Int64?paramIdPosicao
            , Int32 paramUnidadeRastreada
            , Byte?paramOrdemRastreador
            , CancellationToken paramToken
            )
        {
            ServiceResult <Posicao> result = new ServiceResult <Posicao>();

            try
            {
                if (!paramIdPosicao.HasValue)
                {
                    paramIdPosicao = 0;
                }

                result = await DataStore.GetPosition(
                    paramIdPosicao.Value
                    , paramUnidadeRastreada
                    , paramOrdemRastreador
                    , paramToken
                    );
            }
            catch (Exception)
            {
                result.IsValid      = false;
                result.MessageError = "ErroInesperado";
            }

            return(result);
        }
Example #4
0
        ListTracedUnitHistory(
            Int32 paramId
            , String paramData
            , Int32 paramPeriodo
            , Byte?paramOrdemRastreador
            , CancellationToken paramToken
            )
        {
            ServiceResult <List <PosicaoHistorico> > result =
                new ServiceResult <List <PosicaoHistorico> >();

            await Task.Delay(delay);

            try
            {
                result.Data = _lstForListHistorico;
            }
            catch (HttpRequestException)
            {
                result.MessageError = "HttpRequestException";
            }
            catch (Exception)
            {
                result.MessageError = "Exception";
            }

            return(result);
        }
Example #5
0
        public List <LevelRowDTO> GetNewestLevels(Byte?page)
        {
            if (!page.HasValue && (page < 1 || page > 9))
            {
                throw new PR2Exception(ErrorMessages.ERR_INVALID_PAGE);
            }

            // If only SQLite was more powerful... WHOA, look at this beast right here!
            Int64[] levelIds = this.dbContext.LevelVersions
                               .Where(v => v.Level != null && !v.Level.IsDeleted && v.Level.IsPublished)
                               .GroupBy(v => v.Level, (lev, ver) => new { LevelId = lev.Id, SubmittedDate = ver.Max(q => q.SubmittedDate) })
                               .OrderByDescending(l => l.SubmittedDate)
                               .Skip((page.Value - 1) * 9)
                               .Take(9)
                               .Select(l => l.LevelId)
                               .ToArray();

            List <LevelRowDTO> levelRows = this.dbContext.Levels
                                           .Where(l => levelIds.Contains(l.Id))
                                           .Select(Level.ToLevelRowDTO)
                                           .ToList()
                                           .OrderBy(l => Array.IndexOf(levelIds, l.LevelId))
                                           .ToList();

            FillLevelVersionData(levelRows);

            return(levelRows);
        }
Example #6
0
        public static Byte Max(Byte?a, Byte?b, Byte defaultValue = Byte.MinValue)
        {
            var aValue = a.GetValueOrDefault(defaultValue);
            var bValue = b.GetValueOrDefault(defaultValue);

            return(aValue > bValue ? aValue : bValue);
        }
Example #7
0
 public UserOnlineTemp()
 {
     _Sex = (1);
     _AdminType = (0);
     _LastCheckTime = DateTime.Now;
     _Status = (1);
 }
Example #8
0
        public Address(Byte[] data, Byte version = PUBKEY)
        {
            SHA256  sha256    = SHA256.Create();
            IDigest ripemd160 = new RipeMD160Digest();

            switch (version)
            {
            case PUBKEY:
                byte[] pubKeySHA256Res = sha256.ComputeHash(data);
                ripemd160.BlockUpdate(pubKeySHA256Res, 0, pubKeySHA256Res.Length);
                byte[] pubKeyResult = new byte[ripemd160.GetDigestSize()];
                ripemd160.DoFinal(pubKeyResult, 0);
                pubKeyHash = pubKeyResult;
                version    = PUBKEYHASH;
                break;

            case SCRIPT:
                byte[] scriptSHA256Res = sha256.ComputeHash(data);
                ripemd160.BlockUpdate(scriptSHA256Res, 0, scriptSHA256Res.Length);
                byte[] scriptResult = new byte[ripemd160.GetDigestSize()];
                ripemd160.DoFinal(scriptResult, 0);
                scriptHash = scriptResult;
                version    = SCRIPTHASH;
                break;

            case PUBKEYHASH:
                pubKeyHash = data;
                break;

            case SCRIPTHASH:
                scriptHash = data;
                break;
            }
            this.type = version;
        }
Example #9
0
 public BBSMainOfBall()
 {
     _BallType = 1;
     _TopType = 1;
     _AddTime = DateTime.Now;
     _IsShouhu = (0);
 }
Example #10
0
        public void TestUInt64ToByteNullable()
        {
            // Test conversion of source type minimum value
            UInt64 source = UInt64.MinValue;

            Assert.IsInstanceOfType(source, typeof(UInt64));
            Byte?result = source.ToByteNullable();

            Assert.AreEqual((byte)0, result);
            Assert.IsInstanceOfType(result, typeof(Byte));

            // Test conversion of source type value 42 to target type
            source = 42UL;
            Assert.IsInstanceOfType(source, typeof(UInt64));
            result = source.ToByteNullable();
            Assert.AreEqual((byte)42, result);
            Assert.IsInstanceOfType(result, typeof(Byte));

            // Test conversion of source type maximum value
            source = UInt64.MaxValue;
            Assert.IsInstanceOfType(source, typeof(UInt64));
            result = source.ToByteNullable();
            // Here we would expect this conversion to fail (and return null),
            // since the source type's maximum value (18446744073709551615) is greater than the target type's maximum value (255).
            Assert.IsNull(result);
        }
Example #11
0
        /// <summary>
        /// Create a simple time.
        /// </summary>
        /// <param name="Hour">The hour.</param>
        /// <param name="Minute">The minute.</param>
        /// <param name="Second">The second.</param>
        private Time(Byte Hour,
                     Byte Minute = 0,
                     Byte?Second = null)
        {
            #region Initial checks

            if (Hour > 23)
            {
                throw new ArgumentException("The value of the parameter is invalid!", "Hour");
            }

            if (Minute > 59)
            {
                throw new ArgumentException("The value of the parameter is invalid!", "Minute");
            }

            if (Second > 59)
            {
                throw new ArgumentException("The value of the parameter is invalid!", "Second");
            }

            #endregion

            _Hour   = Hour;
            _Minute = Minute;
            _Second = Second;
        }
Example #12
0
        public void TestSByteToByteNullable()
        {
            // Test conversion of source type minimum value
            SByte source = SByte.MinValue;

            Assert.IsInstanceOfType(source, typeof(SByte));
            Byte?result = source.ToByteNullable();

            // Here we would expect this conversion to fail (and return null),
            // since the source type's minimum value (-128) is less than the target type's minimum value (0).
            Assert.IsNull(result);

            // Test conversion of source type value 42 to target type
            source = (sbyte)42;
            Assert.IsInstanceOfType(source, typeof(SByte));
            result = source.ToByteNullable();
            Assert.AreEqual((byte)42, result);
            Assert.IsInstanceOfType(result, typeof(Byte));

            // Test conversion of source type maximum value
            source = SByte.MaxValue;
            Assert.IsInstanceOfType(source, typeof(SByte));
            result = source.ToByteNullable();
            Assert.AreEqual((byte)127, result);
            Assert.IsInstanceOfType(result, typeof(Byte));
        }
Example #13
0
        /**
         * Constructs a <c>NoteRecord</c> and Fills its fields
         * from the supplied <c>RecordInputStream</c>.
         *
         * @param in the stream to Read from
         */

        public NoteRecord(RecordInputStream in1)
        {
            field_1_row     = in1.ReadShort();
            field_2_col     = in1.ReadUShort();
            field_3_flags   = in1.ReadShort();
            field_4_shapeid = in1.ReadUShort();
            int length = in1.ReadShort();

            field_5_hasMultibyte = in1.ReadByte() != 0x00;
            if (field_5_hasMultibyte)
            {
                field_6_author = StringUtil.ReadUnicodeLE(in1, length);
            }
            else
            {
                field_6_author = StringUtil.ReadCompressedUnicode(in1, length);
            }
            if (in1.Available() == 1)
            {
                field_7_padding = (byte)in1.ReadByte();
            }
            else if (in1.Available() == 2 && length == 0)
            {
                // If there's no author, may be double padded
                field_7_padding = (byte)in1.ReadByte();
                in1.ReadByte();
            }
        }
 public EmbeddedObjectRefSubRecord()
 {
     field_2_unknownFormulaData = new byte[] { 0x02, 0x6C, 0x6A, 0x16, 0x01, }; // just some sample data.  These values vary a lot
     field_6_unknown = EMPTY_BYTE_ARRAY;
     field_4_ole_classname = null;
     field_4_unknownByte = null;
 }
Example #15
0
        public void TestInt64ToByteNullable()
        {
            // Test conversion of source type minimum value
            Int64 source = Int64.MinValue;

            Assert.IsInstanceOfType(source, typeof(Int64));
            Byte?result = source.ToByteNullable();

            // Here we would expect this conversion to fail (and return null),
            // since the source type's minimum value (-9223372036854775808) is less than the target type's minimum value (0).
            Assert.IsNull(result);

            // Test conversion of source type value 42 to target type
            source = 42L;
            Assert.IsInstanceOfType(source, typeof(Int64));
            result = source.ToByteNullable();
            Assert.AreEqual((byte)42, result);
            Assert.IsInstanceOfType(result, typeof(Byte));

            // Test conversion of source type maximum value
            source = Int64.MaxValue;
            Assert.IsInstanceOfType(source, typeof(Int64));
            result = source.ToByteNullable();
            // Here we would expect this conversion to fail (and return null),
            // since the source type's maximum value (9223372036854775807) is greater than the target type's maximum value (255).
            Assert.IsNull(result);
        }
Example #16
0
        private String titleS, nameS, descriptionS; //Slå ihop title och name???

        #endregion Fields

        #region Constructors

        //Constructors
        public Event()
        {
            requirementsMaxABYTN = new Byte?[Enum.GetNames(typeof(RequirementsTypes)).Length];
            requirementsMinABYTN = new Byte?[Enum.GetNames(typeof(RequirementsTypes)).Length];
            specialRequirementsDIIS = new Dictionary<SpecialRequirementsTypes, string>();
            alternativesLS = new List<String>();
        }
Example #17
0
        /// <summary>
        /// Create a new GetDiagnostics request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="Location">The URI where the diagnostics file shall be uploaded to.</param>
        /// <param name="StartTime">The timestamp of the oldest logging information to include in the diagnostics.</param>
        /// <param name="StopTime">The timestamp of the latest logging information to include in the diagnostics.</param>
        /// <param name="Retries">The optional number of retries of a charge point for trying to upload the diagnostics before giving up. If this field is not present, it is left to the charge point to decide how many times it wants to retry.</param>
        /// <param name="RetryInterval">The interval after which a retry may be attempted. If this field is not present, it is left to charge point to decide how long to wait between attempts.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public GetDiagnosticsRequest(ChargeBox_Id ChargeBoxId,
                                     String Location,
                                     DateTime?StartTime     = null,
                                     DateTime?StopTime      = null,
                                     Byte?Retries           = null,
                                     TimeSpan?RetryInterval = null,

                                     Request_Id?RequestId             = null,
                                     DateTime?RequestTimestamp        = null,
                                     EventTracking_Id EventTrackingId = null)

            : base(ChargeBoxId,
                   "GetDiagnostics",
                   RequestId,
                   EventTrackingId,
                   RequestTimestamp)

        {
            #region Initial checks

            Location = Location?.Trim();

            if (Location.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(Location), "The given location must not be null or empty!");
            }

            #endregion

            this.Location      = Location;
            this.StartTime     = StartTime;
            this.StopTime      = StopTime;
            this.Retries       = Retries;
            this.RetryInterval = RetryInterval;
        }
Example #18
0
        public async Task <ServiceResult <Posicao> > GetPosition(
            long paramIdPosicao
            , Int32 paramUnidadeRatreada
            , Byte?paramOrdemRastreador
            , CancellationToken paramToken
            )
        {
            ServiceResult <Posicao> result =
                new ServiceResult <Posicao>();

            await Task.Delay(delay);

            try
            {
                result.Data = _detalhePosicao1;
            }
            catch (HttpRequestException)
            {
                result.MessageError = "HttpRequestException";
            }
            catch (Exception)
            {
                result.MessageError = "Exception";
            }

            return(result);
        }
Example #19
0
        /// <summary>
        /// Create a new UpdateFirmware request.
        /// </summary>
        /// <param name="ChargeBoxId">The charge box identification.</param>
        /// <param name="Location">The URI where to download the firmware.</param>
        /// <param name="RetrieveDate">The timestamp after which the charge point must retrieve the firmware.</param>
        /// <param name="Retries">The optional number of retries of a charge point for trying to download the firmware before giving up. If this field is not present, it is left to the charge point to decide how many times it wants to retry.</param>
        /// <param name="RetryInterval">The interval after which a retry may be attempted. If this field is not present, it is left to charge point to decide how long to wait between attempts.</param>
        ///
        /// <param name="RequestId">An optional request identification.</param>
        /// <param name="RequestTimestamp">An optional request timestamp.</param>
        public UpdateFirmwareRequest(ChargeBox_Id ChargeBoxId,
                                     String Location,
                                     DateTime RetrieveDate,
                                     Byte?Retries           = null,
                                     TimeSpan?RetryInterval = null,

                                     Request_Id?RequestId      = null,
                                     DateTime?RequestTimestamp = null)

            : base(ChargeBoxId,
                   "UpdateFirmware",
                   RequestId,
                   RequestTimestamp)

        {
            #region Initial checks

            Location = Location?.Trim();

            if (Location.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(Location), "The given location must not be null or empty!");
            }

            #endregion

            this.Location      = Location;
            this.RetrieveDate  = RetrieveDate;
            this.Retries       = Retries;
            this.RetryInterval = RetryInterval;
        }
Example #20
0
        public void TestInt16ToByteOrDefault()
        {
            // Test conversion of source type minimum value
            Int16 source = Int16.MinValue;

            Assert.IsInstanceOfType(source, typeof(Int16));
            Byte?result = source.ToByteOrDefault((byte)86);

            // Here we would expect this conversion to fail (and return the default value of (byte)86),
            // since the source type's minimum value (-32768) is less than the target type's minimum value (0).
            Assert.AreEqual((byte)86, result);
            Assert.IsInstanceOfType(result, typeof(Byte));
            // Test conversion of source type value 42 to target type
            source = (short)42;
            Assert.IsInstanceOfType(source, typeof(Int16));
            result = source.ToByteOrDefault((byte)86);
            Assert.AreEqual((byte)42, result);
            Assert.IsInstanceOfType(result, typeof(Byte));

            // Test conversion of source type maximum value
            source = Int16.MaxValue;
            Assert.IsInstanceOfType(source, typeof(Int16));
            result = source.ToByteOrDefault((byte)86);
            // Here we would expect this conversion to fail (and return the default value of (byte)86),
            // since the source type's maximum value (32767) is greater than the target type's maximum value (255).
            Assert.AreEqual((byte)86, result);
            Assert.IsInstanceOfType(result, typeof(Byte));
        }
Example #21
0
 public MakersMatch()
 {
     _RegistFees = (0);
     _LimitCount = (0);
     _JoinCount = (0);
     _GmState = (0);
     _GmTime = DateTime.Now;
 }
Example #22
0
 public Card()
 {
     _Price = (0);
     _AllowBuy = (1);
     _AllowSynth = (0);
     _SynthOdds = (0);
     _ProbNum = (0);
 }
Example #23
0
 public BBSDE()
 {
     _ContentType = (1);
     _IsShowTag = 1;
     _IsNiming = 0;
     _AddTime = DateTime.Now;
     _IsDelete = 0;
     _ReDeID = 0;
     _OptionLog = "";
 }
Example #24
0
 public News()
 {
     _IsBold = (0);
     _Keyword = "";
     _NewsSource = "";
     _HitNum = (0);
     _PushType = (0);
     _Status = (1);
     _AddTime = DateTime.Now;
 }
Example #25
0
        /// <summary>
        /// Create a simple time.
        /// </summary>
        /// <param name="Hour">The hour.</param>
        /// <param name="Minute">The minute.</param>
        /// <param name="Second">The second.</param>
        private Time(Byte   Hour,
                     Byte   Minute  = 0,
                     Byte?  Second  = null)
        {
            #region Initial checks

            if (Hour > 23)
                throw new ArgumentException("The value of the parameter is invalid!", "Hour");

            if (Minute > 59)
                throw new ArgumentException("The value of the parameter is invalid!", "Minute");

            if (Second > 59)
                throw new ArgumentException("The value of the parameter is invalid!", "Second");

            #endregion

            _Hour    = Hour;
            _Minute  = Minute;
            _Second  = Second;
        }
Example #26
0
 public Address(Byte[] data, Byte version = PUBKEY)
 {
     SHA256 sha256 = new SHA256Managed();
     RIPEMD160 ripemd160 = new RIPEMD160Managed();
     switch (version)
     {
         case PUBKEY:
             pubKeyHash = ripemd160.ComputeHash(sha256.ComputeHash(data));
             version = PUBKEYHASH;
             break;
         case SCRIPT:
             scriptHash = ripemd160.ComputeHash(sha256.ComputeHash(data));
             version = SCRIPTHASH;
             break;
         case PUBKEYHASH:
             pubKeyHash = data;
             break;
         case SCRIPTHASH:
             scriptHash = data;
             break;
     }
     this.type = version;
 }
Example #27
0
 public BBSMain()
 {
     _TypeMainID = 1;
     _TitleColor = "";
     _Types = 0;
     _FileType = 1;
     _FilePath = "";
     _IsShowTag = 1;
     _IsNiming = 0;
     _IsVote = 0;
     _AddTime = DateTime.Now;
     _PushType = 0;
     _ChenmoType = 0;
     _DeleteType = 0;
     _BallType = 0;
     _LastReTime = DateTime.Now;
     _HitNum = 0;
     _ReNum = 0;
     _OptionLog = "";
     _Score = 0;
     _IsBoyun = (0);
     _IsTianshen = (0);
     _IsBubinglei = (0);
 }
Example #28
0
        /**
         * Constructs a <c>NoteRecord</c> and Fills its fields
         * from the supplied <c>RecordInputStream</c>.
         *
         * @param in the stream to Read from
         */
        public NoteRecord(RecordInputStream in1)
        {
            field_1_row = in1.ReadShort();
            field_2_col = in1.ReadUShort();
            field_3_flags = in1.ReadShort();
            field_4_shapeid = in1.ReadUShort();
            int length = in1.ReadShort();
		    field_5_hasMultibyte = in1.ReadByte() != 0x00;
		    if (field_5_hasMultibyte) {
			    field_6_author = StringUtil.ReadUnicodeLE(in1, length);
		    } else {
			    field_6_author = StringUtil.ReadCompressedUnicode(in1, length);
		    }
 		    if (in1.Available() == 1) {
			    field_7_padding = (byte)in1.ReadByte();
		    }
        }
        /**
         * Constructs an EmbeddedObjectRef record and Sets its fields appropriately.
         *
         * @param in the record input stream.
         */
        public EmbeddedObjectRefSubRecord(ILittleEndianInput in1, int size)
        {
            // Much guess-work going on here due to lack of any documentation.
            // See similar source code in OOO:
            // http://lxr.go-oo.org/source/sc/sc/source/filter/excel/xiescher.cxx
            // 1223 void XclImpOleObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nRecSize )

            int streamIdOffset = in1.ReadShort(); // OOO calls this 'nFmlaLen'
            int remaining = size - LittleEndianConsts.SHORT_SIZE;

            int dataLenAfterFormula = remaining - streamIdOffset;
            int formulaSize = in1.ReadUShort();

            remaining -= LittleEndianConsts.SHORT_SIZE;
            field_1_unknown_int = in1.ReadInt();
            remaining -= LittleEndianConsts.INT_SIZE;
            byte[] formulaRawBytes = ReadRawData(in1, formulaSize);
            remaining -= formulaSize;
            field_2_refPtg = ReadRefPtg(formulaRawBytes);
            if (field_2_refPtg == null)
            {
                // common case
                // field_2_n16 seems to be 5 here
                // The formula almost looks like tTbl but the row/column values seem like garbage.
                field_2_unknownFormulaData = formulaRawBytes;
            }
            else
            {
                field_2_unknownFormulaData = null;
            }


            int stringByteCount;
            if (remaining >= dataLenAfterFormula + 3)
            {
                int tag = in1.ReadByte();
                stringByteCount = LittleEndianConsts.BYTE_SIZE;
                if (tag != 0x03)
                {
                    throw new RecordFormatException("Expected byte 0x03 here");
                }
                int nChars = in1.ReadUShort();
                stringByteCount += LittleEndianConsts.SHORT_SIZE;
                if (nChars > 0)
                {
                    // OOO: the 4th way Xcl stores a unicode string: not even a Grbit byte present if Length 0
                    field_3_unicode_flag = (in1.ReadByte() & 0x01) != 0;
                    stringByteCount += LittleEndianConsts.BYTE_SIZE;
                    if (field_3_unicode_flag)
                    {
                        field_4_ole_classname = StringUtil.ReadUnicodeLE(in1,nChars);
                        stringByteCount += nChars * 2;
                    }
                    else
                    {
                        field_4_ole_classname = StringUtil.ReadCompressedUnicode(in1,nChars);
                        stringByteCount += nChars;
                    }
                }
                else
                {
                    field_4_ole_classname = "";
                }
            }
            else
            {
                field_4_ole_classname = null;
                stringByteCount = 0;
            }
            remaining -= stringByteCount;
            // Pad to next 2-byte boundary
            if (((stringByteCount + formulaSize) % 2) != 0)
            {
                int b = in1.ReadByte();
                remaining -= LittleEndianConsts.BYTE_SIZE;
                if (field_2_refPtg != null && field_4_ole_classname == null)
                {
                    field_4_unknownByte = (byte)b;
                }
            }
            int nUnexpectedPadding = remaining - dataLenAfterFormula;

            if (nUnexpectedPadding > 0)
            {
                logger.Log(POILogger.ERROR, "Discarding " + nUnexpectedPadding + " unexpected padding bytes ");
                ReadRawData(in1, nUnexpectedPadding);
                remaining -= nUnexpectedPadding;
            }

            // Fetch the stream ID
            if (dataLenAfterFormula >= 4)
            {
                field_5_stream_id = in1.ReadInt();
                remaining -= LittleEndianConsts.INT_SIZE;
            }
            else
            {
                field_5_stream_id = null;
            }

            field_6_unknown = ReadRawData(in1, remaining);
        }
Example #30
0
 public OfficialMatch()
 {
     _JoinCount = (0);
     _GmState = (0);
     _GmTime = DateTime.Now;
 }
Example #31
0
 /**
  * Construct a new <c>NoteRecord</c> and
  * Fill its data with the default values
  */
 public NoteRecord()
 {
     field_6_author = "";
     field_3_flags = 0;
     field_7_padding = DEFAULT_PADDING; // seems to be always present regardless of author text  
 }
    /**
     * @param in the stream to read data from
     * @param cbFContinued the seconf short in the record header
     * @param cmoOt the Containing Obj's {@link CommonObjectDataSubRecord#field_1_objectType}
     */
        public LbsDataSubRecord(ILittleEndianInput in1, int cbFContinued, int cmoOt)
        {
            _cbFContinued = cbFContinued;

            int encodedTokenLen = in1.ReadUShort();
            if (encodedTokenLen > 0)
            {
                int formulaSize = in1.ReadUShort();
                _unknownPreFormulaInt = in1.ReadInt();

                Ptg[] ptgs = Ptg.ReadTokens(formulaSize, in1);
                if (ptgs.Length != 1)
                {
                    throw new RecordFormatException("Read " + ptgs.Length
                            + " tokens but expected exactly 1");
                }
                _linkPtg = ptgs[0];
                switch (encodedTokenLen - formulaSize - 6)
                {
                    case 1:
                        _unknownPostFormulaByte = (byte)in1.ReadByte();
                        break;
                    case 0:
                        _unknownPostFormulaByte = null;
                        break;
                    default:
                        throw new RecordFormatException("Unexpected leftover bytes");
                }
            }

            _cLines = in1.ReadUShort();
            _iSel = in1.ReadUShort();
            _flags = in1.ReadUShort();
            _idEdit = in1.ReadUShort();

            // From [MS-XLS].pdf 2.5.147 FtLbsData:
            // This field MUST exist if and only if the Containing Obj?s cmo.ot is equal to 0x14.
            if (cmoOt == 0x14)
            {
                _dropData = new LbsDropData(in1);
            }

            // From [MS-XLS].pdf 2.5.147 FtLbsData:
            // This array MUST exist if and only if the fValidPlex flag (0x2) is set
            if ((_flags & 0x2) != 0)
            {
                _rgLines = new String[_cLines];
                for (int i = 0; i < _cLines; i++)
                {
                    _rgLines[i] = StringUtil.ReadUnicodeString(in1);
                }
            }

            // bits 5-6 in the _flags specify the type
            // of selection behavior this list control is expected to support

            // From [MS-XLS].pdf 2.5.147 FtLbsData:
            // This array MUST exist if and only if the wListType field is not equal to 0.
            if (((_flags >> 4) & 0x2) != 0)
            {
                _bsels = new bool[_cLines];
                for (int i = 0; i < _cLines; i++)
                {
                    _bsels[i] = in1.ReadByte() == 1;
                }
            }

        }
Example #33
0
File: Pixel.cs Project: Nucs/nlib
 public void Dispose() {
     Red = null;
     Green = null;
     Blue = null;
 }
Example #34
0
 private Byte calcHash()
 {
     Byte version;
     Byte[] hash = Base58CheckString.ToByteArray(this.ToString(), out version);
     switch (version)
     {
         case PUBKEYHASH:
             pubKeyHash = hash;
             break;
         case SCRIPTHASH:
             scriptHash = hash;
             break;
     }
     type = version;
     return version;
 }
 public NetworkPlayerID(Guid id)
 {
     NonPlayerId = id;
     ID = null;
 }
 public NetworkPlayerID(Byte id)
 {
     ID = id;
     NonPlayerId = null;
 }
Example #37
0
 public UserReports()
 {
     _AddTime = DateTime.Now;
     _Status = 0;
     _JiangliType = (0);
 }
Example #38
0
        public TextObjectRecord(RecordInputStream in1)
        {

            field_1_options = in1.ReadUShort();
            field_2_textOrientation = in1.ReadUShort();
            field_3_reserved4 = in1.ReadUShort();
            field_4_reserved5 = in1.ReadUShort();
            field_5_reserved6 = in1.ReadUShort();
            int field_6_textLength = in1.ReadUShort();
            int field_7_formattingDataLength = in1.ReadUShort();
            field_8_reserved7 = in1.ReadInt();

            if (in1.Remaining > 0)
            {
                // Text Objects can have simple reference formulas
                // (This bit not mentioned in the MS document)
                if (in1.Remaining < 11)
                {
                    throw new RecordFormatException("Not enough remaining data for a link formula");
                }
                int formulaSize = in1.ReadUShort();
                _unknownPreFormulaInt = in1.ReadInt();
                Ptg[] ptgs = Ptg.ReadTokens(formulaSize, in1);
                if (ptgs.Length != 1)
                {
                    throw new RecordFormatException("Read " + ptgs.Length
                            + " tokens but expected exactly 1");
                }
                _linkRefPtg = (OperandPtg)ptgs[0];
                if (in1.Remaining > 0)
                {
                    _unknownPostFormulaByte = (byte)in1.ReadByte();
                }
                else
                {
                    _unknownPostFormulaByte = null;
                }
            }
            else
            {
                _linkRefPtg = null;
            }
            if (in1.Remaining > 0)
            {
                throw new RecordFormatException("Unused " + in1.Remaining + " bytes at end of record");
            }

            String text;
            if (field_6_textLength > 0)
            {
                text = ReadRawString(in1, field_6_textLength);
            }
            else
            {
                text = "";
            }
            _text = new HSSFRichTextString(text);

            if (field_7_formattingDataLength > 0)
            {
                ProcessFontRuns(in1, _text, field_7_formattingDataLength);
            }
        }