/// <summary>
        /// elenco di CSP nel sistema windows
        /// </summary>
        /// <param name="lastError">ultimo errore nella funzionalità</param>
        /// <returns>elenco di CSP nel sistema windows</returns>
        public static List <string> CSPs(ref string lastError)
        {
            List <string> csps = null;

            try
            {
                Chilkat.Csp         csp = new Chilkat.Csp();
                Chilkat.StringTable st  = new Chilkat.StringTable();

                bool success = csp.GetProviders(st);
                if (success == false)
                {
                    lastError = csp.LastErrorText;
                    return(null);
                }

                // lista csp su sistema windows
                int i            = 0;
                int numProviders = st.Count;
                csps = new List <string>();
                while (i < numProviders)
                {
                    csps.Add(st.StringAt(i));
                    i++;
                }
            }
            catch
            {
                throw;
            }

            return(csps);
        }
예제 #2
0
        static public ArrayList GetGenericClassNameList()
        {
            Chilkat.StringTable st = new Chilkat.StringTable();
            if (m_classListText == null)
            {
                m_classListText = AppData.GetAppData("appData/apiManager/classList.txt");
                if (m_classListText == null)
                {
                    return(null);
                }
            }
            Chilkat.StringBuilder sb = new Chilkat.StringBuilder();
            sb.Append(m_classListText);

            if (!st.AppendFromSb(sb))
            {
                return(null);
            }

            ArrayList alist = new ArrayList();

            int n = st.Count;
            int i;

            for (i = 0; i < n; i++)
            {
                string cname = st.StringAt(i);
                if (string.IsNullOrWhiteSpace(cname))
                {
                    continue;
                }
                alist.Add(cname);
            }

            return(alist);
        }
예제 #3
0
        // Demonstrates how to iterate over Chilkat classes to generate wrappers for some programming language..
        private void button1_Click(object sender, EventArgs e)
        {
            Chilkat.StringTable classList = new Chilkat.StringTable();
            bool success = classList.AppendFromFile(1000, "utf-8", ChilkatApi.GenBase.ClassListFile);

            if (!success)
            {
                MessageBox.Show("Failed to load class list, modify the value of AppDataDir.BaseDir");
                return;
            }

            //MessageBox.Show("Number of classes = " + Convert.ToString(classList.Count));

            for (int i = 0; i < classList.Count; i++)
            {
                string genericClassName = classList.StringAt(i);
                if (!GenerateClass(genericClassName))
                {
                    textBox1.Text += "Failed to generate " + genericClassName + "\r\n";
                    return;
                }
                textBox1.Text += genericClassName + "\r\n";
            }
        }