protected string GetSPSite() { if (String.IsNullOrWhiteSpace(Site) || Site.StartsWith("http://") || Site.StartsWith("https://")) { return(Site); } var fileName = GetPresetFilename(Site); if (!File.Exists(fileName)) { throw new RuntimeException($"File not found: \"{fileName}\""); } SearchConnection sc = new SearchConnection(); sc.Load(fileName); if (sc.SpSiteUrl == null) { throw new ArgumentException($"Unable to load valid saved site information from the file \"{fileName}\""); } return(sc.SpSiteUrl); }
private string GetSPSite() { if (String.IsNullOrWhiteSpace(Site) || Site.StartsWith("http://") || Site.StartsWith("https://")) { return(Site); } var fileName = GetPresetFilename(Site); SearchConnection sc = new SearchConnection(); sc.Load(fileName); return(sc.SpSiteUrl); }