Server.Commands.CategoryLine.Load C# (CSharp) Méthode

Load() public static méthode

public static Load ( string path ) : Server.Commands.CategoryLine[]
path string
Résultat Server.Commands.CategoryLine[]
		public static CategoryLine[] Load( string path )
		{
			ArrayList list = new ArrayList();

			if ( File.Exists( path ) )
			{
				using ( StreamReader ip = new StreamReader( path ) )
				{
					string line;

					while ( (line = ip.ReadLine()) != null )
						list.Add( new CategoryLine( line ) );
				}
			}

			return (CategoryLine[])list.ToArray( typeof( CategoryLine ) );
		}
	}

Usage Example

Exemple #1
0
        private static CategoryEntry Load(List <Type> types, string config)
        {
            CategoryLine[] lines = CategoryLine.Load(config);

            if (lines.Length > 0)
            {
                int           index = 0;
                CategoryEntry root  = new CategoryEntry(null, lines, ref index);

                Fill(root, types);

                return(root);
            }

            return(new CategoryEntry());
        }