Exemplo n.º 1
0
        public Main()
        {
            InitializeComponent();

            this.Icon = Resources.icon;

            // Check for first start
            LoadConfig();
            if (!config.Exists)
            {
                Startup startup = new Startup(this);
                startup.ShowDialog();
                if (!config.Exists)
                {
                    Environment.Exit(0);
                }
            }

            if (!Directory.Exists(config.ServerPath) || !Directory.EnumerateFileSystemEntries(config.ServerPath).Any())
            {
                btnConfig.Enabled = false;

                if (MessageBox.Show("Seems like you don't have a server yet.\nDo you want to create it now?", "Server not found!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    //Create Server here
                    ServerCreator creator = new ServerCreator(this);
                    creator.ShowDialog();
                }
            }
            else
            {
                btnConfig.Enabled = true;
            }

            // Add ListView images
            ImageList imageList = new ImageList();

            imageList.ImageSize = new Size(20, 20);
            imageList.Images.Add("Folder", Resources.imgFolder);
            imageList.Images.Add("File", Resources.imgFile);
            imageList.Images.Add("Java", Resources.imgJava);
            imageList.Images.Add("XML", Resources.imgXML);
            imageList.Images.Add("Json", Resources.imgJson);
            imageList.Images.Add("SQL", Resources.imgSQL);
            imageList.Images.Add("Txt", Resources.imgTxt);
            treeView.ImageList = imageList;
        }
Exemplo n.º 2
0
        private void btnCreator_Click(object sender, EventArgs e)
        {
            ServerCreator creator = new ServerCreator(this);

            creator.ShowDialog();
        }