예제 #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.GetVersion();

            if (version < 2)
            {
                WebForm = new DonationWebFormOptions();
            }

            switch (version)
            {
            case 4:
                FallbackAccount = reader.ReadAccount();
                goto case 3;

            case 3:
                CreditBonus = reader.ReadDouble();
                goto case 2;

            case 2:
                WebForm = new DonationWebFormOptions(reader);
                goto case 1;

            case 1:
                TierFactor = reader.ReadDouble();
                goto case 0;

            case 0:
            {
                if (version < 2)
                {
                    new MySQLConnectionInfo(reader);                    // MySQL

                    _CurrencyType = new ItemTypeSelectProperty(reader); // CurrencyType

                    reader.ReadString();                                // TableName
                }

                ShowHistory = reader.ReadBool();

                if (version < 2)
                {
                    CurrencyPrice = reader.ReadDouble();                             // UnitPrice
                }

                MoneySymbol = reader.ReadChar();

                if (version < 2)
                {
                    MoneyAbbr = reader.ReadString();               // MoneyAbbr
                    reader.ReadBool();                             // GiftingEnabled
                }
            }
            break;
            }

            Info = new DonationStatistics();
        }
예제 #2
0
        public DonationOptions()
            : base(typeof(AutoDonate))
        {
            WebForm = new DonationWebFormOptions();

            MoneySymbol = '$';
            ShowHistory = false;
            TierFactor  = 0.0;
            CreditBonus = 0.0;

            Info = new DonationStatistics();
        }
예제 #3
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			var version = reader.GetVersion();

			if (version < 2)
			{
				WebForm = new DonationWebFormOptions();
			}

			switch (version)
			{
				case 4:
					FallbackAccount = reader.ReadAccount();
					goto case 3;
				case 3:
					CreditBonus = reader.ReadDouble();
					goto case 2;
				case 2:
					WebForm = new DonationWebFormOptions(reader);
					goto case 1;
				case 1:
					TierFactor = reader.ReadDouble();
					goto case 0;
				case 0:
				{
					if (version < 2)
					{
						new MySQLConnectionInfo(reader); // MySQL

						_CurrencyType = new ItemTypeSelectProperty(reader); // CurrencyType

						reader.ReadString(); // TableName
					}

					ShowHistory = reader.ReadBool();

					if (version < 2)
					{
						CurrencyPrice = reader.ReadDouble(); // UnitPrice
					}

					MoneySymbol = reader.ReadChar();

					if (version < 2)
					{
						MoneyAbbr = reader.ReadString(); // MoneyAbbr
						reader.ReadBool(); // GiftingEnabled
					}
				}
					break;
			}

			Info = new DonationStatistics();
		}
예제 #4
0
		public DonationOptions()
			: base(typeof(AutoDonate))
		{
			WebForm = new DonationWebFormOptions();

			MoneySymbol = '$';
			ShowHistory = false;
			TierFactor = 0.0;
			CreditBonus = 0.0;

			Info = new DonationStatistics();
		}