Esempio n. 1
0
 public DriveInfo(PSDriveInfo driveInfo, NewDriveParameters parameters) : base(driveInfo)
 {
     if (parameters == null)
     {
         throw new ArgumentNullException("parameters");
     }
     if (string.IsNullOrEmpty(parameters.WebUrl))
     {
         throw new ArgumentException(
                   "The WebUrl parameter cannot be empty. It must point to a SharePoint web site.");
     }
     ConnectorType = !string.IsNullOrEmpty(parameters.Connector) ?
                     parameters.Connector : "SOAP";
     WebUrl          = parameters.WebUrl;
     Timeout         = parameters.Timeout;
     CacheKeepPeriod = parameters.CacheKeepPeriod.Ticks == 0 ?
                       new TimeSpan(0, 0, 2) : parameters.CacheKeepPeriod;
     if (string.IsNullOrEmpty(Description))
     {
         Description = string.Format("Makes the SharePoint content at {0} " +
                                     "accessible as you work with the local file system.",
                                     PathUtility.JoinPath(WebUrl, Root));
     }
     Connector = CreateConnector();
 }
Esempio n. 2
0
 public DriveInfo(PSDriveInfo driveInfo, NewDriveParameters parameters)
     : base(driveInfo)
 {
     if (parameters == null)
         throw new ArgumentNullException("parameters");
     if (string.IsNullOrEmpty(parameters.WebUrl))
         throw new ArgumentException(
             "The WebUrl parameter cannot be empty. It must point to a SharePoint web site.");
     ConnectorType = !string.IsNullOrEmpty(parameters.Connector) ?
                             parameters.Connector : "SOAP";
     WebUrl = parameters.WebUrl;
     Timeout = parameters.Timeout;
     CacheKeepPeriod = parameters.CacheKeepPeriod.Ticks == 0 ?
                             new TimeSpan(0, 0, 2) : parameters.CacheKeepPeriod;
     if (string.IsNullOrEmpty(Description))
         Description = string.Format("Makes the SharePoint content at {0} " +
             "accessible as you work with the local file system.",
             PathUtility.JoinPath(WebUrl, Root));
     Connector = CreateConnector();
 }