OneDrive/ODConnection.cs
/// <summary>
/// Crates an item reference for a path (and optionally driveId) relative to the root of the user's OneDrive.
/// 
/// For example, to reference a file "bar.txt" in folder "Foo" in the root of a drive you would set drivePath to "/Foo/bar.txt".
/// </summary>
/// <param name="drivePath"></param>
/// <param name="driveId"></param>
/// <returns></returns>
Crates an item reference for a path (and optionally driveId) relative to the root of the user's OneDrive.


Crates an item reference for a path ( and optionally driveId ) relative to the root of the user ' s OneDrive .
public static ODItemReference ItemReferenceForDrivePath(string drivePath, string driveId = null)
        {
            if (null == drivePath)
                throw new ArgumentNullException("drivePath", "drivePath cannot be null");
            if (drivePath.StartsWith("/", StringComparison.Ordinal))
                drivePath = drivePath.Substring(1);
            if (driveId == null)
                return new ODItemReference { Path = string.Concat("/drive/root:/", drivePath) };
            else
                return new ODItemReference { DriveId = driveId, Path = string.Concat("/drives/", driveId, "/root:/", drivePath) };
        }
public static ODItemReference ItemReferenceForDrivePath ( string drivePath , string driveId = null ) { if ( null == drivePath ) throw new ArgumentNullException ( " " , " " ) ; if ( drivePath . StartsWith ( " " , StringComparison . Ordinal ) ) drivePath = drivePath . Substring ( 1 ) ; if ( driveId == null ) return new ODItemReference { Path = string . Concat ( " " , drivePath ) } ; else return new ODItemReference { DriveId = driveId , Path = string . Concat ( " " , driveId , " " , drivePath ) } ; }
Crates an item reference for a path (and optionally driveId) relative to the root of the user's OneDrive.
Crates an item reference for a path ( and optionally driveId ) relative to the root of the user ' s OneDrive .
None
drivePath
string
None
driveId
string
None