Exemplo n.º 1
0
        private void ListComponentFiles(ComboBox Input, ComboBox Output, ComponentDownloader.ComponentType ServerType)
        {
            ComponentDownloader Comp = new ComponentDownloader();

            // Selected Server/Module files.
            if (ServerType == ComponentDownloader.ComponentType.WebServer)
            {
                Comp = CompWS;
            }
            if (ServerType == ComponentDownloader.ComponentType.PHP)
            {
                Comp = CompPHP;
            }
            if (ServerType == ComponentDownloader.ComponentType.DataBase)
            {
                Comp = CompDB;
            }

            Comp.SelTypes = ServerType;
            int ServerId = 0;

            if (Comp.LoadServerList())
            {
                foreach (DataRow Row in Comp.SvrList.Rows)
                {
                    if (Row["FullName"].ToString().CompareTo(Input.SelectedItem.ToString()) == 0)
                    {
                        ServerId = Convert.ToInt32(Row["Id"]);
                        break;
                    }
                }
            }
            else
            {
                return;
            }

            if (Comp.LoadServerFileList(ServerId))
            {
                Output.Items.Clear();

                if (Comp.SvrURLs.Rows.Count > 0)
                {
                    foreach (DataRow row in Comp.SvrURLs.Rows)
                    {
                        try
                        {
                            Output.Items.Add(Comp.CleanURL(row["URL"].ToString()));
                        }
                        catch (Exception ex)
                        {
                            Globals.Error.Show(ex.Message);
                        }
                    }

                    Output.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 2
0
        private void InstallComponentsWindow(ComponentDownloader.ComponentType type)
        {
            ComponentDownloader ComponentDialog = new ComponentDownloader();

            ComponentDialog.SelTypes = type;

            ComponentDialog.ShowDialog();
            ComponentDialog.Dispose();

            LoadCombos();
        }