JuneTools.LocalStorageValue.GetValuesFromDictionary C# (CSharp) Method

GetValuesFromDictionary() public static method

Gets the values from dictionary.
public static GetValuesFromDictionary ( object>.IDictionary dictionary ) : List
dictionary object>.IDictionary Dictionary.
return List
        public static List<LocalStorageValue> GetValuesFromDictionary(IDictionary<string, object> dictionary)
        {
            List<LocalStorageValue> values = new List<LocalStorageValue>();
            if(null != dictionary) {
                foreach(var kv in dictionary) {
                    values.Add(new LocalStorageValue(kv));
                }
            }
            return values;
        }

Usage Example

        /// <summary>
        /// Refreshs the data.
        /// </summary>
        private void RefreshData()
        {
            if (null != this.VALUES)
            {
                this.VALUES.Clear();
            }
            var dictionary = LocalStore.Instance.GetSerializedData();

            if (null != dictionary)
            {
                this.VALUES = LocalStorageValue.GetValuesFromDictionary(dictionary);
            }
        }