Example #1
0
        // 创建同步设置面板
        private void CreateSyncSettingPanel()
        {
            // 创建同步目录文本框
            CharmTextBox txtSyncDir = new CharmTextBox
            {
                Location = new Point(127 + MENU_WIDTH, 20 + TITLE_HEIGHT),
                Width = 260
            };
            // 创建浏览路径按钮
            CharmButton btnViewPath = new CharmButton
            {
                ButtonType = ButtonType.Classic_Size_08223,
                Text = "浏览路径",
                ForeColor = Color.DarkGreen,
                Location = new Point(399 + MENU_WIDTH, 22 + TITLE_HEIGHT)
            };

            // 创建同步周期文本框
            CharmTextBox txtSyncCycle = new CharmTextBox
            {
                Location = new Point(127 + MENU_WIDTH, 55 + TITLE_HEIGHT),
                Width = 50,
                TextInputMode = InputMode.Integer,
                MaxLength = 5,
                TextAlign = HorizontalAlignment.Center
            };

            // 创建空间名称文本框
            CharmTextBox txtBucket = new CharmTextBox
            {
                Location = new Point(290 + MENU_WIDTH, 55 + TITLE_HEIGHT),
                Width = 95,
            };

            // 创建私有空间检查框
            CharmCheckBox chkPrivateBucket = new CharmCheckBox
            {
                Location = new Point(400 + MENU_WIDTH, 57 + TITLE_HEIGHT),
                Text = "私有空间"
            };

            // 创建同步前缀文本框
            CharmTextBox txtPrefix = new CharmTextBox
            {
                Location = new Point(150 + MENU_WIDTH, 90 + TITLE_HEIGHT),
                Width = 95,
            };

            // 创建监控变动检查框
            CharmCheckBox chkCaptureChange = new CharmCheckBox
            {
                Location = new Point(260 + MENU_WIDTH, 92 + TITLE_HEIGHT),
                Text = "监控目录文件变化"
            };

            // 创建立即同步按钮
            CharmButton btnSyncNow = new CharmButton
            {
                ButtonType = ButtonType.Classic_Size_08223,
                Text = "立即同步",
                ForeColor = Color.Purple,
                Location = new Point(399 + MENU_WIDTH, 92 + TITLE_HEIGHT)
            };

            // 创建 AccessKey 文本框
            CharmTextBox txtAccessKey = new CharmTextBox
            {
                Location = new Point(127 + MENU_WIDTH, 160 + TITLE_HEIGHT),
                Width = 260,
                TextInputMode = InputMode.Password
            };
            // 创建查看 AccessKey 按钮
            CharmButton btnViewAccessKey = new CharmButton
            {
                ButtonType = ButtonType.Classic_Size_08223,
                Text = "查看密钥",
                ForeColor = Color.Red,
                Location = new Point(399 + MENU_WIDTH, 162 + TITLE_HEIGHT)
            };

            // 创建 SecretKey 文本框
            CharmTextBox txtSecretKey = new CharmTextBox
            {
                Location = new Point(127 + MENU_WIDTH, 195 + TITLE_HEIGHT),
                Width = 260,
                TextInputMode = InputMode.Password
            };
            // 创建查看 SecretKey 按钮
            CharmButton btnViewSecretKey = new CharmButton
            {
                ButtonType = ButtonType.Classic_Size_08223,
                Text = "查看密钥",
                ForeColor = Color.Red,
                Location = new Point(399 + MENU_WIDTH, 197 + TITLE_HEIGHT)
            };

            // 创建七牛开发平台链接标签
            CharmLinkLabel lblQiniuOpen = new CharmLinkLabel
            {
                Location = new Point(280, 265),
                ForeColor = Color.Blue,
                Text = "七牛云存储开发者平台"
            };

            // 关联控件事件
            txtSyncDir.TextChanged += txtSyncDir_TextChanged;
            btnViewPath.MouseClick += btnViewPath_MouseClick;
            txtSyncCycle.TextChanged += txtSyncDir_TextChanged;
            txtBucket.TextChanged += txtSyncDir_TextChanged;
            chkPrivateBucket.MouseClick += chkPrivateBucket_MouseClick;
            lblQiniuOpen.MouseClick += lblQiniuOpen_MouseClick;
            txtAccessKey.TextChanged += txtSyncDir_TextChanged;
            btnViewAccessKey.MouseClick += btnViewAccessKey_MouseClick;
            txtSecretKey.TextChanged += txtSyncDir_TextChanged;
            btnViewSecretKey.MouseClick += btnViewSecretKey_MouseClick;
            txtPrefix.TextChanged += txtSyncDir_TextChanged;
            chkCaptureChange.MouseClick += chkPrivateBucket_MouseClick;
            btnSyncNow.MouseClick += btnSyncNow_MouseClick;

            // 将控件添加到集合中
            this.Controls.Add(txtSyncDir);
            this.Controls.Add(txtSyncCycle);
            this.Controls.Add(txtAccessKey);
            this.Controls.Add(txtSecretKey);
            this.Controls.Add(txtBucket);
            this.Controls.Add(txtPrefix);

            // 创建同步设置面板控件集合
            mSyncSettingControls = new List<Control> { txtSyncDir, txtSyncCycle, txtAccessKey, txtSecretKey, txtBucket, txtPrefix };
            mSyncSettingCharmControls = new List<CharmControl> { btnViewPath, lblQiniuOpen, btnViewAccessKey, btnViewSecretKey, chkPrivateBucket, chkCaptureChange, btnSyncNow };
        }
Example #2
0
        // 创建关于面板
        private void CreateAboutPanel()
        {
            // 创建 GitHub 链接标签
            CharmLinkLabel lblGithub = new CharmLinkLabel
            {
                Location = new Point(185, 145),
                Font = new Font("微软雅黑", 10),
                ForeColor = Color.Blue,
                Text = "github.com/Unknwon/qiniudrive"
            };

            // 创建新浪微博链接标签
            CharmLinkLabel lblSina = new CharmLinkLabel
            {
                Location = new Point(330, 223),
                Font = new Font("微软雅黑", 10),
                ForeColor = Color.Blue,
                Text = "@无闻Unknown"
            };

            // 关联控件事件
            lblGithub.MouseClick += lblGithub_MouseClick;
            lblSina.MouseClick += lblSina_MouseClick;

            // 创建关于面板控件集合
            mAboutCharmControls = new List<CharmControl> { lblGithub, lblSina };
        }