Beispiel #1
0
        /// <summary>
        /// 加载ClientState
        /// </summary>
        /// <param name="clientState">序列化后的clientState</param>
        /// <remarks>加载ClientState</remarks>
        protected override void LoadClientState(string clientState)
        {
            base.LoadClientState(clientState);

            object[] foArray = JSONSerializerExecute.Deserialize <object[]>(clientState);

            if (foArray != null && foArray.Length > 0)
            {
                //已选择列表的Items
                if (foArray[0] != null && foArray.Length > 0)
                {
                    this.selectedItems = (SelectItemCollection)JSONSerializerExecute.DeserializeObject(foArray[0], typeof(SelectItemCollection));
                }
                //待选择列表的Items
                if (foArray[1] != null && foArray.Length > 1)
                {
                    this.candidateItems = (SelectItemCollection)JSONSerializerExecute.DeserializeObject(foArray[1], typeof(SelectItemCollection));
                }
                //按钮的Items
                if (foArray[2] != null && foArray.Length > 2)
                {
                    this.buttonItems = (ButtonItemCollection)JSONSerializerExecute.DeserializeObject(foArray[2], typeof(ButtonItemCollection));
                }

                //deltaItems
                if (foArray[3] != null && foArray.Length > 3)
                {
                    this.deltaItems = (DeltaItemCollection)JSONSerializerExecute.DeserializeObject(foArray[3], typeof(DeltaItemCollection));
                }
            }
        }
		/// <summary>
		/// 加载ClientState
		/// </summary>
		/// <param name="clientState">序列化后的clientState</param>
		/// <remarks>加载ClientState</remarks>
		protected override void LoadClientState(string clientState)
		{
			base.LoadClientState(clientState);

			object[] foArray = JSONSerializerExecute.Deserialize<object[]>(clientState);

			if (foArray != null && foArray.Length > 0)
			{
				//已选择列表的Items
				if (foArray[0] != null && foArray.Length > 0)
				{
					this.selectedItems = (SelectItemCollection)JSONSerializerExecute.DeserializeObject(foArray[0], typeof(SelectItemCollection));
				}
				//待选择列表的Items
				if (foArray[1] != null && foArray.Length > 1)
				{
					this.candidateItems = (SelectItemCollection)JSONSerializerExecute.DeserializeObject(foArray[1], typeof(SelectItemCollection));
				}
				//按钮的Items
				if (foArray[2] != null && foArray.Length > 2)
				{
					this.buttonItems = (ButtonItemCollection)JSONSerializerExecute.DeserializeObject(foArray[2], typeof(ButtonItemCollection));
				}

				//deltaItems
				if (foArray[3] != null && foArray.Length > 3)
				{
					this.deltaItems = (DeltaItemCollection)JSONSerializerExecute.DeserializeObject(foArray[3], typeof(DeltaItemCollection));
				}
			}

		}