Beispiel #1
0
        private void PublishDocumentDlgLoad(List <KeyValuePair <Server, JToken> > listServerFolders)
        {
            if (PanoramaPublishClient == null)
            {
                PanoramaPublishClient = new WebPanoramaPublishClient();
            }
            var listErrorServers = new List <Server>();

            foreach (var server in _panoramaServers)
            {
                JToken folders = null;
                try
                {
                    folders = PanoramaPublishClient.GetInfoForFolders(server, null);
                }
                catch (WebException)
                {
                    listErrorServers.Add(server);
                }
                listServerFolders.Add(new KeyValuePair <Server, JToken>(server, folders));
            }
            if (listErrorServers.Count > 0)
            {
                throw new Exception(TextUtil.LineSeparate(Resources.PublishDocumentDlg_PublishDocumentDlgLoad_Failed_attempting_to_retrieve_information_from_the_following_servers_,
                                                          string.Empty,
                                                          ServersToString(listErrorServers)));
            }
        }
Beispiel #2
0
        private void PublishDocumentDlgLoad(List <KeyValuePair <Server, JToken> > listServerFolders)
        {
            if (PanoramaPublishClient == null)
            {
                PanoramaPublishClient = new WebPanoramaPublishClient();
            }
            var listErrorServers = new List <Tuple <Server, string> >();

            foreach (var server in _panoramaServers)
            {
                JToken folders = null;
                try
                {
                    folders = PanoramaPublishClient.GetInfoForFolders(server, null);
                }
                catch (Exception ex)
                {
                    if (ex is WebException || ex is PanoramaServerException)
                    {
                        var error = ex.Message;
                        if (Resources
                            .EditServerDlg_OkDialog_The_username_and_password_could_not_be_authenticated_with_the_panorama_server
                            .Equals(error))
                        {
                            error = TextUtil.LineSeparate(error, Resources
                                                          .PublishDocumentDlg_PublishDocumentDlgLoad_Go_to_Tools___Options___Panorama_tab_to_update_the_username_and_password_);
                        }

                        listErrorServers.Add(new Tuple <Server, string>(server, error));
                    }
                    else
                    {
                        throw;
                    }
                }
                listServerFolders.Add(new KeyValuePair <Server, JToken>(server, folders));
            }
            if (listErrorServers.Count > 0)
            {
                throw new Exception(TextUtil.LineSeparate(Resources.PublishDocumentDlg_PublishDocumentDlgLoad_Failed_attempting_to_retrieve_information_from_the_following_servers_,
                                                          string.Empty,
                                                          ServersToString(listErrorServers)));
            }
        }