Пример #1
0
        private void InitControls()
        {
            InitializeComponent();

            this.Text   = Program.Title;
            this.Icon   = Resources.ZUploader;
            niTray.Icon = Resources.ZUploaderSmallIcon;

            foreach (string imageUploader in ZAppHelper.GetEnumDescriptions <ImageDestination>())
            {
                tsmiImageUploaders.DropDownItems.Add(new ToolStripMenuItem(imageUploader));
            }
            tsmiImageUploaders.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsddbImageUploaders_DropDownItemClicked);

            foreach (string fileUploader in ZAppHelper.GetEnumDescriptions <FileDestination>())
            {
                tsmiFileUploaders.DropDownItems.Add(new ToolStripMenuItem(fileUploader));
            }
            tsmiFileUploaders.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsddbFileUploaders_DropDownItemClicked);

            foreach (string textUploader in ZAppHelper.GetEnumDescriptions <TextDestination>())
            {
                tsmiTextUploaders.DropDownItems.Add(new ToolStripMenuItem(textUploader));
            }
            tsmiTextUploaders.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsddbTextUploaders_DropDownItemClicked);

            foreach (string urlShortener in ZAppHelper.GetEnumDescriptions <UrlShortenerType>())
            {
                tsmiURLShorteners.DropDownItems.Add(new ToolStripMenuItem(urlShortener));
            }
            tsmiURLShorteners.DropDownItemClicked += new ToolStripItemClickedEventHandler(tsddbURLShorteners_DropDownItemClicked);

            ImageList il = new ImageList();

            il.ColorDepth = ColorDepth.Depth32Bit;
            il.Images.Add(Properties.Resources.navigation_090_button);
            il.Images.Add(Properties.Resources.cross_button);
            il.Images.Add(Properties.Resources.tick_button);
            il.Images.Add(Properties.Resources.navigation_000_button);
            lvUploads.SmallImageList = il;
            lvUploads.FillLastColumn();

            UploadManager.ListViewControl = lvUploads;

#if DEBUG
            // Test button: Left click uploads test image. Right click opens capture test window.
            tsbDebug.Visible = true;
#endif
        }