/// <summary>
 /// Renders the toolbar.
 /// </summary>
 private void RenderToolbar()
 {
     GUILayout.BeginHorizontal(EditorStyles.toolbar);
     if (GUILayout.Button("Create New", EditorStyles.toolbarButton))
     {
         this._NewValue      = new LocalStorageValue(new KeyValuePair <string, object> (string.Empty, 0));
         this._IsCreatingNew = true;
     }
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("Print", EditorStyles.toolbarButton))
     {
         DebugPrint(this.VALUES);
     }
     if (GUILayout.Button("Save All", EditorStyles.toolbarButton))
     {
         SaveAll();
         RefreshData();
     }
     if (GUILayout.Button("Refresh/Restore", EditorStyles.toolbarButton))
     {
         RefreshData();
     }
     if (GUILayout.Button("DELETE ALL DATA", EditorStyles.toolbarButton))
     {
         if (EditorUtility.DisplayDialog("Delete All Data", "Are you sure you want to delete all the data?", "YES", "NO"))
         {
             LocalStore.Instance.DeleteAll();
             RefreshData();
         }
     }
     GUILayout.EndHorizontal();
 }
        /// <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);
            }
        }
 /// <summary>
 /// Renders the toolbar.
 /// </summary>
 private void RenderToolbar()
 {
     GUILayout.BeginHorizontal (EditorStyles.toolbar);
     if (GUILayout.Button ("Create New", EditorStyles.toolbarButton)) {
         this._NewValue = new LocalStorageValue (new KeyValuePair<string, object> (string.Empty, 0));
         this._IsCreatingNew = true;
     }
     GUILayout.FlexibleSpace ();
     if (GUILayout.Button ("Print", EditorStyles.toolbarButton)) {
         DebugPrint (this.VALUES);
     }
     if (GUILayout.Button ("Save All", EditorStyles.toolbarButton)) {
         SaveAll ();
         RefreshData ();
     }
     if (GUILayout.Button ("Refresh/Restore", EditorStyles.toolbarButton)) {
         RefreshData ();
     }
     if (GUILayout.Button ("DELETE ALL DATA", EditorStyles.toolbarButton)) {
         if (EditorUtility.DisplayDialog ("Delete All Data", "Are you sure you want to delete all the data?", "YES", "NO")) {
             LocalStore.Instance.DeleteAll ();
             RefreshData ();
         }
     }
     GUILayout.EndHorizontal ();
 }
 /// <summary>
 /// Renders the create new section.
 /// </summary>
 void RenderCreateNew()
 {
     if (null == this._NewValue) {
         this._NewValue = new LocalStorageValue (new KeyValuePair<string, object> (string.Empty, 0f));
     }
     GUILayout.BeginArea (new Rect (5, 20, position.width - 10, 98), BoxStyle);
     GUILayout.Space (3);
     GUILayout.Label ("Create New", EditorStyles.boldLabel);
     this._NewValue.Name = EditorGUILayout.TextField ("Key : ", this._NewValue.Name);
     GUILayout.BeginHorizontal ();
     switch (this._NewValue.Type) {
     case ValueType.Int:
         this._NewValue.Value = EditorGUILayout.IntField ("Initial Value : ", this._NewValue.IntValue);
         break;
     case ValueType.Float:
         this._NewValue.Value = EditorGUILayout.FloatField ("Initial Value : ", this._NewValue.FloatValue);
         break;
     case ValueType.String:
         this._NewValue.Value = EditorGUILayout.TextField ("Initial Value : ", this._NewValue.StringValue);
         break;
     }
     ValueType valType = (ValueType)EditorGUILayout.EnumPopup (this._NewValue.Type, GUILayout.MaxWidth (80));
     if (this._NewValue.Type != valType) {
         Logger.Log ("SETTING FROM:" + this._NewValue.Type + " TO:" + valType);
         string name = this._NewValue.Name;
         object obj = string.Empty;
         if (valType == ValueType.Int) {
             obj = 0;
         }
         else
             if (valType == ValueType.Float) {
                 obj = 0f;
             }
         this._NewValue = new LocalStorageValue (name, obj);
     }
     this._NewValue.Type = valType;
     GUILayout.EndHorizontal ();
     GUILayout.Space (4);
     GUILayout.BeginHorizontal ();
     GUILayout.FlexibleSpace ();
     if (GUILayout.Button ("Create")) {
         if (null == this.VALUES) {
             this.VALUES = new List<LocalStorageValue> ();
         }
         this.VALUES.Add (this._NewValue);
         this.SaveAll ();
         this._IsCreatingNew = false;
     }
     if (GUILayout.Button ("Cancel")) {
         this._IsCreatingNew = false;
         this._NewValue = null;
     }
     GUILayout.EndHorizontal ();
     GUILayout.Space (5);
     GUILayout.EndArea ();
     GUILayout.Space (104);
 }
        /// <summary>
        /// Renders the create new section.
        /// </summary>
        void RenderCreateNew()
        {
            if (null == this._NewValue)
            {
                this._NewValue = new LocalStorageValue(new KeyValuePair <string, object> (string.Empty, 0f));
            }
            GUILayout.BeginArea(new Rect(5, 20, position.width - 10, 98), BoxStyle);
            GUILayout.Space(3);
            GUILayout.Label("Create New", EditorStyles.boldLabel);
            this._NewValue.Name = EditorGUILayout.TextField("Key : ", this._NewValue.Name);
            GUILayout.BeginHorizontal();
            switch (this._NewValue.Type)
            {
            case ValueType.Int:
                this._NewValue.Value = EditorGUILayout.IntField("Initial Value : ", this._NewValue.IntValue);
                break;

            case ValueType.Float:
                this._NewValue.Value = EditorGUILayout.FloatField("Initial Value : ", this._NewValue.FloatValue);
                break;

            case ValueType.String:
                this._NewValue.Value = EditorGUILayout.TextField("Initial Value : ", this._NewValue.StringValue);
                break;
            }
            ValueType valType = (ValueType)EditorGUILayout.EnumPopup(this._NewValue.Type, GUILayout.MaxWidth(80));

            if (this._NewValue.Type != valType)
            {
                Logger.Log("SETTING FROM:" + this._NewValue.Type + " TO:" + valType);
                string name = this._NewValue.Name;
                object obj  = string.Empty;
                if (valType == ValueType.Int)
                {
                    obj = 0;
                }
                else
                if (valType == ValueType.Float)
                {
                    obj = 0f;
                }
                this._NewValue = new LocalStorageValue(name, obj);
            }
            this._NewValue.Type = valType;
            GUILayout.EndHorizontal();
            GUILayout.Space(4);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Create"))
            {
                if (null == this.VALUES)
                {
                    this.VALUES = new List <LocalStorageValue> ();
                }
                this.VALUES.Add(this._NewValue);
                this.SaveAll();
                this._IsCreatingNew = false;
            }
            if (GUILayout.Button("Cancel"))
            {
                this._IsCreatingNew = false;
                this._NewValue      = null;
            }
            GUILayout.EndHorizontal();
            GUILayout.Space(5);
            GUILayout.EndArea();
            GUILayout.Space(104);
        }