コード例 #1
0
ファイル: Form1.cs プロジェクト: kartverket/geosynk-TMP
        /// <summary>
        ///     Returnerer det som tilbyder støtter av dataset, filter operatorer og objekttyper.
        /// </summary>
        /// <returns></returns>
        private void GetCapabilitiesXml(string url, string UserName, string Password)
        {
            dgvProviderDataset.DataSource = _synchController.GetCapabilitiesProviderDataset(url, UserName, Password);
            List <string> visibleColumns = new List <string>()
            {
                "Name",
                "ProviderDatasetId",
                "Applicationschema"
            };

            foreach (DataGridViewColumn col in dgvProviderDataset.Columns)
            {
                if (!visibleColumns.Contains(col.Name))
                {
                    col.Visible = false;
                }
                else
                {
                    col.SortMode = DataGridViewColumnSortMode.Automatic;
                }
            }

            dgvProviderDataset.AutoSize            = true;
            dgvProviderDataset.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
        }
コード例 #2
0
        public static bool IsProviderActive(string url, string userName, string password)
        {
            var synchController = new SynchController();

            try
            {
                Console.Out.WriteLine(" Start DistributorActive: " + url);
                var sTransactionSummary = GetTransactionSummary(synchController);
                //
                var responseDistributor = synchController.GetCapabilitiesProviderDataset(url, userName, password);
                Console.Out.WriteLine(" Finished DistributorActive: " + url);
                return(responseDistributor.Count > 0);
            }
            catch (Exception e)
            {
                var sErr = "Exception istributorActive: " + url + ", Error desc: " + e.Message;
                Console.Out.WriteLine(sErr);
                return(false);
                //throw;
            }
        }