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

            var version = reader.GetVersion();

            switch (version)
            {
            case 1:
                Desc = reader.ReadString();
                goto case 0;

            case 0:
            {
                Type      = reader.ReadType();
                Name      = reader.ReadString();
                CanIgnore = reader.ReadBool();

                States = reader.ReadBlockDictionary(
                    r =>
                    {
                        var state = new NotifySettingsState(this, r);

                        return(new KeyValuePair <IAccount, NotifySettingsState>(state.Owner.Account, state));
                    });
            }
            break;
            }
        }
Example #2
0
        public NotifySettingsState EnsureState(IAccount a)
        {
            var s = States.GetValue(a);

            if (s == null || s.Settings != this)
            {
                States[a] = s = new NotifySettingsState(this, a);
            }

            return(s);
        }
Example #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            reader.GetVersion();

            Type = reader.ReadType();
            Name = reader.ReadString();
            Desc = reader.ReadString();

            CanIgnore    = reader.ReadBool();
            CanAutoClose = reader.ReadBool();

            States = reader.ReadBlockDictionary(
                r =>
            {
                var state = new NotifySettingsState(this, r);

                return(new KeyValuePair <IAccount, NotifySettingsState>(state.Owner, state));
            },
                States);
        }
Example #4
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
				case 1:
					Desc = reader.ReadString();
					goto case 0;
				case 0:
					{
						Type = reader.ReadType();
						Name = reader.ReadString();
						CanIgnore = reader.ReadBool();

						States = reader.ReadBlockDictionary(
							r =>
							{
								var state = new NotifySettingsState(this, r);

								return new KeyValuePair<PlayerMobile, NotifySettingsState>(state.Owner, state);
							});
					}
					break;
			}
		}