private void removeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Configuration != null)
     {
         UploadSettingsConfigSection section = (UploadSettingsConfigSection)Configuration.GetSection("UploadSettings");
         if (section != null)
         {
             section.UploadSettings.Remove(Element);
             Parent.Controls.Remove(this);
         }
     }
 }
        private void addPanelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            UploadSettingsConfigSection section = (UploadSettingsConfigSection)configuration.GetSection("UploadSettings");

            if (section != null)
            {
                UploadElement uploadElement = new UploadElement {
                    UploadType = "NAS", Color = 0, Active = false
                };
                section.UploadSettings.Add(uploadElement);
                Panels.Controls.Add(new PanelConfig(uploadElement, configuration));
            }
        }
        public SettingsForm()
        {
            InitializeComponent();

            configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            UploadSettingsConfigSection section = (UploadSettingsConfigSection)configuration.GetSection("UploadSettings");

            if (section != null)
            {
                foreach (UploadElement uploadElement in section.UploadSettings)
                {
                    Panels.Controls.Add(new PanelConfig(uploadElement, configuration));
                }
            }
        }
        public UploadForm(bool keepAlive, Rectangle canvas)
        {
            InitializeComponent();

            this.ResizeRedraw = true;

            Main.Panel1Collapsed = !keepAlive;
            int           height                = keepAlive ? 23 : 0;
            Configuration configuration         = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            UploadSettingsConfigSection section = (UploadSettingsConfigSection)configuration.GetSection("UploadSettings");

            if (section != null)
            {
                foreach (UploadElement uploadElement in section.UploadSettings)
                {
                    UploadPanel panel = new UploadPanel();
                    panel.BackColor   = Color.FromArgb(uploadElement.Color);
                    panel.Dock        = DockStyle.Top;
                    panel.Height      = 50;
                    panel.Width       = 100;
                    panel.Upload     += new UploadAction(panel_Upload);
                    panel.Description = uploadElement.Description;
                    Main.Panel2.Controls.Add(panel);
                    height += 50;
                }
            }

            SetDesktopBounds(canvas.Right - 150, canvas.Bottom - height, 100, height);

            fadeTimer          = new Timer();
            fadeTimer.Interval = 5000;
            fadeTimer.Tick    += new EventHandler(fadeTimer_Tick);
            if (!keepAlive)
            {
                fadeTimer.Start();
            }
        }