Пример #1
0
        public Form1()
        {
            InitializeComponent();

            try
            {
                ServiceKeyClientMessageInspector.ServiceKey = _apiClient.GetTimeLimitedServiceKey();

                DistributionServices = _apiClient.GetServices(ServiceTypes.QlikViewDistributionService);

                if (DistributionServices == null)
                {
                    return;
                }

                bindingSource1.DataSource    = DistributionServices;
                cboQvdServices.DataSource    = bindingSource1.DataSource;
                cboQvdServices.DisplayMember = "Name";
                cboQvdServices.ValueMember   = "Name";

                GetQDSSettings();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
        }
Пример #2
0
        private static ServiceInfo FindService(IQMS client, ServiceTypes serviceType, string serviceName)
        {
            List <ServiceInfo> service = client.GetServices(serviceType);

            if (service != null && service.Count > 0)
            {
                return(service.FirstOrDefault(x => x.Name.Equals(serviceName)));
            }
            return(null);
        }
Пример #3
0
 private static Guid FindServiceId(ServiceTypes serviceType, string serviceName)
 {
     try
     {
         List <ServiceInfo> service = client.GetServices(serviceType);
         if (service != null && service.Count > 0)
         {
             return(service.FirstOrDefault(x => x.Name.Equals(serviceName)).ID);
         }
         else
         {
             commSupport.PrintMessage("Could not find " + serviceName + " service. Make sure cluster name is correct", true);
         }
     }
     catch (Exception)
     {
         commSupport.PrintMessage("Exception when trying to fetch " + serviceName + ". Make sure cluster name is correct", true);
     }
     return(Guid.Empty);
 }
Пример #4
0
        static void Main(string[] args)
        {
            if (args.Length == 0 || args[0] == "-h")
            {
                PrintUsage();
                return;
            }

            //try
            //{
                // create a QMS API client
                apiClient = new QMSClient();

                //If you want to connect to a server different from the one used when creating the service reference,
                //do as follows:                                
                // 
                //NTLM only (default installation)
                //IQMS apiClient = new QMSClient("BasicHttpBinding_IQMS", "http://*****:*****@"\\unc\some", Name = "MyMount" });
                //    // save settings
                //    apiClient.SaveQVSSettings(qvsSettings);
                //    Console.WriteLine("Settings saved. New mount added.");
                //}
            //}
            //catch (System.Exception ex)
            //{
            //    Console.WriteLine("An exception occurred: " + ex.Message);
            //}
            // wait for user to press any key
            //Console.ReadLine();
        }
Пример #5
0
        static void Main(string[] args)
        {
            if (args.Length == 0 || args[0] == "-h")
            {
                PrintUsage();
                return;
            }

            //try
            //{
            // create a QMS API client
            apiClient = new QMSClient();

            //If you want to connect to a server different from the one used when creating the service reference,
            //do as follows:
            //
            //NTLM only (default installation)
            //IQMS apiClient = new QMSClient("BasicHttpBinding_IQMS", "http://*****:*****@"\\unc\some", Name = "MyMount" });
            //    // save settings
            //    apiClient.SaveQVSSettings(qvsSettings);
            //    Console.WriteLine("Settings saved. New mount added.");
            //}
            //}
            //catch (System.Exception ex)
            //{
            //    Console.WriteLine("An exception occurred: " + ex.Message);
            //}
            // wait for user to press any key
            //Console.ReadLine();
        }