/// <summary> /// Use this method to report any problems that occurred while the user was browsing for External Resources. /// Revit will call this method each time the end user browses to a new folder location, or selects an item /// and clicks Open. /// </summary> public void HandleBrowseResult(ExternalResourceUIBrowseResultType resultType, string browsingItemPath) { if (resultType == ExternalResourceUIBrowseResultType.Success) { return; } String resultString = resultType.ToString("g"); // While executing its SetupBrowserData() method, the "DB server" - SampleExternalResourceServer - can store // detailed information about browse failures that occurred (user not logged in, network down, etc.). // Subsequently, when Revit calls this method, the details can be read from the DB server and reported to the user. ExternalService externalResourceService = ExternalServiceRegistry.GetService(ExternalServices.BuiltInExternalServices.ExternalResourceService); if (externalResourceService == null) { System.Windows.Forms.MessageBox.Show("External Resource Service unexpectedly not found."); return; } SampleExternalResourceDBServer myDBServer = externalResourceService.GetServer(GetDBServerId()) as SampleExternalResourceDBServer; if (myDBServer == null) { System.Windows.Forms.MessageBox.Show("Cannot get SampleExternalResourceDBServer from ExternalResourceService."); return; } // ... Retrieve detailed failure information from SampleExternalResourceServer here. String message = String.Format("The browse result for <{0}> was: <{1}>.", browsingItemPath, resultString); System.Windows.Forms.MessageBox.Show(message); }
public void HandleBrowseResult(ExternalResourceUIBrowseResultType resultType, string browsingItemPath) { }