src/MonoTorrent.Client/MonoTorrent/Torrent.cs
/// <summary>
/// Loads a .torrent from the specificed path. A return value indicates
/// whether the operation was successful.
/// </summary>
/// <param name="path">The path to load the .torrent file from</param>
/// <param name="torrent">If the loading was succesful it is assigned the Torrent</param>
/// <returns>True if successful</returns>
Loads a .torrent from the specificed path. A return value indicates
whether the operation was successful.
Loads a . torrent from the specificed path . A return value indicates whether the operation was successful .
public static bool TryLoad (string path, out Torrent torrent)
        {
            Check.Path (path);
            torrent = null;
            try {
                if (!string.IsNullOrEmpty (path) && File.Exists (path))
                    torrent = Load (path);
            } catch {
            }
            return torrent != null;
        }
public static bool TryLoad ( string path , out Torrent torrent ) { Check . Path ( path ) ; torrent = null ; try { if ( ! string . IsNullOrEmpty ( path ) && File . Exists ( path ) ) torrent = Load ( path ) ; } catch { } return torrent != null ; }
Loads a .torrent from the specificed path.
Loads a . torrent from the specificed path .
// We will return false if an exception is thrown as 'torrent' will still // be null.
True if successful
True if successful
path
string
The path to load the .torrent file from
The path to load the . torrent file from
Torrent
out
torrent
If the loading was succesful it is assigned the Torrent
If the loading was succesful it is assigned the Torrent