Пример #1
0
        /// <summary>
        /// <para>Guarda los ajustes</para>
        /// </summary>
        private static void GuardarAjustes()// Guarda los ajustes
        {
            bool   primero       = true;
            string textoGuardado = "";
            string nombreAjustes;

            foreach (DictionaryEntry data in ajustes)
            {
                if (!primero)
                {
                    textoGuardado += "\n";
                }
                else
                {
                    primero = false;
                }

                nombreAjustes = data.Key as string;
                if (ajustes.ContainsKey(data.Key))
                {
                    textoGuardado += nombreAjustes + "☐" + ajustes[nombreAjustes];
                }
            }

            MTodoManagerLecturaEscritura.GuardarArchivo(textoGuardado, pathArchivo);
        }
Пример #2
0
        /// <summary>
        /// <para>Carga los ajustes</para>
        /// </summary>
        private static void CargarAjustes()// Carga los ajustes
        {
            ajustes = new Hashtable();
            string[] textoCargado = MTodoManagerLecturaEscritura.LeerArchivo(pathArchivo);

            try
            {
                foreach (string stringItem in textoCargado)
                {
                    string[] splitedString = stringItem.Split('☐');
                    if (splitedString.Length != 2)
                    {
                        Debug.LogWarning("[TodoTareas]: La longitud de los elementos no es 2");
                        continue;
                    }

                    ajustes.Add(splitedString[0], splitedString[1]);
                }
            }
            catch (NullReferenceException)
            {
                ajustes = new Hashtable();
            }
        }