Ejemplo n.º 1
0
        /// <summary>
        /// Files to string array.
        /// </summary>
        /// <param name="FileName">Name of the file.</param>
        /// <returns>System.String[].</returns>
        public static string[] FileToStringArray(string FileName)
        {
            string Text = TextIO.FileToString(FileName);

            if (Text.IndexOf(Environment.NewLine) < 0)
            {
                return(Split(Text, "\n"));
            }
            return(Split(Text, Environment.NewLine));
        }
 /// <summary>
 /// Files to object.
 /// </summary>
 /// <param name="FileName">Name of the file.</param>
 /// <param name="xObject">The x object.</param>
 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
 public static bool FileToObject(string FileName, ref object xObject)
 {
     try
     {
         string Serialized = TextIO.FileToString(FileName);
         return(StringToObject(Serialized, ref xObject));
     }
     catch (Exception EX)
     {
     }
     return(false);
 }
 /// <summary>
 /// Objects to file.
 /// </summary>
 /// <param name="xObject">The x object.</param>
 /// <param name="FileName">Name of the file.</param>
 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
 public static bool ObjectToFile(object xObject, string FileName)
 {
     try
     {
         string Serialized = ObjectToString(xObject);
         TextIO.StringToFile(FileName, Serialized);
         return(true);
     }
     catch (Exception EX)
     {
     }
     return(false);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Files to string array.
        /// </summary>
        /// <param name="FileName">Name of the file.</param>
        /// <param name="Split">The split.</param>
        /// <returns>System.String[].</returns>
        public static string[] FileToStringArray(string FileName, string Split)
        {
            string Text = TextIO.FileToString(FileName);

            return(Text.Split(new string[] { Split }, StringSplitOptions.RemoveEmptyEntries));
        }