コード例 #1
0
ファイル: UserDataDeposit.cs プロジェクト: mingzhixx/bvcusdk
        public int DepositAData(object userData)
        {
            int          iSN          = buildASN();
            UserDataItem userDataItem = new UserDataItem(iSN, userData);

            m_userdata_list.Add(userDataItem);
            return(iSN);
        }
コード例 #2
0
 /// <summary>
 /// Note Supported
 /// </summary>
 /// <param name="item"></param>
 public void Visit(UserDataItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     // Ignore for now.
 }
コード例 #3
0
 /// <summary>
 /// Validate user visit.
 /// </summary>
 /// <param name="item"></param>
 public void Visit(UserDataItem item)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     // Not tested with current data file, obsolete.
     throw new NotImplementedException();
 }
コード例 #4
0
 protected void SetUserItemData(JSONObject jsonObject)
 {
     // Update every data item with the data on disk
     for (int i = 0; i < userDataItems.Count; i++)
     {
         UserDataItem userDataItem       = userDataItems[i];
         JSONObject   userDataJsonObject = jsonObject[userDataItem.UserDataKey()].AsObject;
         userDataItem.Load(userDataJsonObject);
     }
 }
コード例 #5
0
        public static UserDataItem MapUserData(IDataReader reader)
        {
            UserDataItem item          = new UserDataItem();
            int          startingindex = 0;

            item.Id          = reader.GetInt32(startingindex++);
            item.FirstName   = reader.GetString(startingindex++);
            item.LastName    = reader.GetString(startingindex++);
            item.PhoneNumber = reader.GetString(startingindex++);

            return(item);
        }
コード例 #6
0
    protected JSONObject GetUserItemData()
    {
        JSONObject json_data = new JSONObject();

        // Stitch all the data items together.
        for (int i = 0; i < userDataItems.Count; i++)
        {
            UserDataItem userDataItem = userDataItems[i];
            JSONObject   jsonObject   = userDataItem.Save();
            json_data[userDataItem.UserDataKey()] = jsonObject;
        }

        return(json_data);
    }
コード例 #7
0
        public static UserDataItem GetUserDataItem(int id)
        {
            UserDataItem item = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.UserData_SelectById"
                                    , inputParamMapper : delegate(SqlParameterCollection UserDataCollection)
            {
                UserDataCollection.AddWithValue("@Id", id);
            }, map : delegate(IDataReader reader, short set)
            {
                item = MapUserData(reader);
            });
            return(item);
        }
コード例 #8
0
ファイル: DataService.cs プロジェクト: amselem/bgguwp
 private async void RetrieveCredentials()
 {
     Windows.Security.Credentials.PasswordCredential credentials = StorageService.RetrieveUserCredentials();
     if (credentials != null)
     {
         BGGUsername = credentials.UserName;
         BGGPassword = credentials.Password;
         BGGUser     = new UserDataItem(await Client.LoadUserDetails(BGGUsername));
     }
     else
     {
         // TODO Should display error message
     }
 }
コード例 #9
0
        public static List <UserDataItem> GetUserDataItemList()
        {
            List <UserDataItem> list = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.UserData_SelectAll",
                                    inputParamMapper : null, map : delegate(IDataReader reader, short set)
            {
                UserDataItem item = MapUserData(reader);

                if (list == null)
                {
                    list = new List <UserDataItem>();
                }
                list.Add(item);
            }
                                    );
            return(list);
        }
コード例 #10
0
ファイル: UserDataDeposit.cs プロジェクト: mingzhixx/bvcusdk
        /// <summary>
        /// 通过索引获取用户数据
        /// </summary>
        /// <param name="iSN">索引</param>
        /// <param name="bIsDelete">获取用户数据后,是否删除m_userdata_list中该数据</param>
        /// <returns></returns>
        public object GetUserDataByIndex(int iSN, bool bIsDelete)
        {
            UserDataItem userDataItem = null;
            object       userData     = null;

            foreach (UserDataItem item in m_userdata_list)
            {
                if (item.IndexEquals(iSN))
                {
                    userDataItem = item;
                }
            }

            if (null != userDataItem)
            {
                //m_userdata_list.Remove(userDataItem);
                userData = userDataItem.GetUserData();
            }
            return(userData);
        }
コード例 #11
0
ファイル: MathMLElement.cs プロジェクト: olesar/Altaxo
 /// <summary>
 /// setUserData introduced in DOM Level 3
 /// Associate an object to a key on this node. The by calling getUserData with the same key.
 /// </summary>
 /// <param name="key">The key to associate the object to.</param>
 /// <param name="data">The object to associate to the given key, or null to remove
 /// any existing association to that key.</param>
 /// <param name="handler">The handler to associate to that key, or null.</param>
 /// <returns>the user data previously associated to the given key on this node, or
 /// null if there was none.</returns>
 public object SetUserData(string key, object data, UserDataHandler handler)
 {
     for (int i = 0; i < userData.Length; i++)
     {
         if (userData[i].key == key)
         {
             object result = userData[i].data;
             userData[i].data    = data;
             userData[i].handler = handler;
             return(result);
         }
     }
     UserDataItem[] newUserData = new UserDataItem[userData.Length + 1];
     for (int i = 0; i < userData.Length; i++)
     {
         newUserData[i] = userData[i];
     }
     newUserData[newUserData.Length - 1].key     = key;
     newUserData[newUserData.Length - 1].data    = data;
     newUserData[newUserData.Length - 1].handler = handler;
     userData = newUserData;
     return(data);
 }
コード例 #12
0
ファイル: MathMLElement.cs プロジェクト: Altaxo/Altaxo
		/// <summary>
		/// setUserData introduced in DOM Level 3
		/// Associate an object to a key on this node. The by calling getUserData with the same key.
		/// </summary>
		/// <param name="key">The key to associate the object to.</param>
		/// <param name="data">The object to associate to the given key, or null to remove 
		/// any existing association to that key.</param>
		/// <param name="handler">The handler to associate to that key, or null.</param>
		/// <returns>the user data previously associated to the given key on this node, or 
		/// null if there was none.</returns>
		public object SetUserData(string key, object data, UserDataHandler handler)
		{
			for(int i = 0; i < userData.Length; i++)
			{
				if(userData[i].key == key)
				{
					object result = userData[i].data;
					userData[i].data = data;
					userData[i].handler = handler;
					return result;					
				}
			}
			UserDataItem[] newUserData = new UserDataItem[userData.Length + 1];
			for(int i = 0; i < userData.Length; i++)
			{
				newUserData[i] = userData[i];
			}
			newUserData[newUserData.Length - 1].key = key;
			newUserData[newUserData.Length - 1].data = data;
			newUserData[newUserData.Length - 1].handler = handler;
			userData = newUserData;
			return data;
		}
コード例 #13
0
 public void AddUserDataItem(UserDataItem item)
 {
     userDataItems.Add(item);
 }