Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
 /// <summary>
 ///     Upload File
 /// </summary>
 private void UploadFileStripButton_Click(object sender, EventArgs e)
 {
     var upfile = new OpenFileDialog();
     if (upfile.ShowDialog() == DialogResult.OK)
     {
         var opt = new Gfs.UpLoadFileOption();
         var frm = new FrmGfsOption();
         frm.ShowDialog();
         opt.AlreadyOpt = frm.Option;
         opt.DirectorySeparatorChar = frm.DirectorySeparatorChar;
         opt.FileNameOpt = frm.Filename;
         opt.IgnoreSubFolder = frm.IgnoreSubFolder;
         Gfs.UpLoadFile(upfile.FileName, opt, null);
         RefreshGui();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 ///     上传文件夹
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void UpLoadFolderStripButton_Click(object sender, EventArgs e)
 {
     var upfolder = new FolderBrowserDialog();
     if (upfolder.ShowDialog() == DialogResult.OK)
     {
         var opt = new Gfs.UpLoadFileOption();
         var frm = new FrmGfsOption();
         frm.ShowDialog();
         opt.AlreadyOpt = frm.Option;
         opt.DirectorySeparatorChar = frm.DirectorySeparatorChar;
         opt.FileNameOpt = frm.Filename;
         opt.IgnoreSubFolder = frm.IgnoreSubFolder;
         var uploadDir = new DirectoryInfo(upfolder.SelectedPath);
         var count = 0;
         UploadFolder(uploadDir, ref count, opt);
         MyMessageBox.ShowMessage("Upload", "Upload Completed! Upload Files Count: " + count);
         RefreshGui();
     }
 }
Exemplo n.º 3
0
        /// <summary>
        ///     获得数据对象方法的注入
        /// </summary>
        private static void GetInject()
        {
            //新建文档的文档获得方法注入
            CtlDocumentView._getDocument = () =>
            {
                var frmInsertDoc = new frmCreateDocument();
                UIAssistant.OpenModalForm(frmInsertDoc, false, true);
                return frmInsertDoc.mBsonDocument;
            };
            ctlBsonValue.GetDocument = () =>
            {
                var frmInsertDoc = new frmCreateDocument();
                UIAssistant.OpenModalForm(frmInsertDoc, false, true);
                return frmInsertDoc.mBsonDocument;
            };
            ctlBsonValue.GetArray = () =>
            {
                var frmInsertArray = new frmArrayCreator();
                UIAssistant.OpenModalForm(frmInsertArray, false, true);
                return frmInsertArray.mBsonArray;
            };
            ctlBsonValue.GetGeoPoint = () =>
            {
                var frmGeo = new frmCreateGeo();
                UIAssistant.OpenModalForm(frmGeo, false, true);
                return frmGeo.mBsonArray;
            };
            frmGeoNear.GetGeo = () =>
            {
                var frmGeo = new frmCreateGeo();
                UIAssistant.OpenModalForm(frmGeo, false, true);
                return frmGeo.mBsonArray;
            };

            FrmServerMonitor.FreshTimeChanged = (time) =>
            {
                SystemManager.SystemConfig.RefreshStatusTimer = time;
                SystemManager.SystemConfig.SaveSystemConfig();
            };

            FrmServerMonitor.MonitorItemsChanged = (items) =>
            {
                SystemManager.SystemConfig.MonitorItems = items;
                SystemManager.SystemConfig.SaveSystemConfig();
            };

            RuntimeMongoDbContext.GetPassword = (username) =>
            {
                var Password = MyMessageBox.ShowPasswordInput("Please Input Password of " + username, "Password");
                return Password;
            };

            CtlUserView.OpenAddNewUserForm = (isAdmin) =>
            {
                UIAssistant.OpenModalForm(new FrmUser(isAdmin), true, true);
            };
            CtlUserView.OpenChangePasswordForm = (isAdmin, name) =>
            {
                UIAssistant.OpenModalForm(new FrmUser(isAdmin, name), true, true);
            };

            CtlDocumentView.ElementOp = (isUpdate, selectedNode, isElement) =>
            {
                var f = new FrmElement(isUpdate, selectedNode, isElement);
                f.ShowDialog();
            };
            CtlGfsView.GetUploadFileOption = () =>
            {
                var opt = new Gfs.UpLoadFileOption();
                var frm = new FrmGfsOption();
                frm.ShowDialog();
                opt.AlreadyOpt = frm.Option;
                opt.DirectorySeparatorChar = frm.DirectorySeparatorChar;
                opt.FileNameOpt = frm.Filename;
                opt.IgnoreSubFolder = frm.IgnoreSubFolder;
                return opt;
            };
        }