Skip to content

Commit

Permalink
GFS拖曳功能等
Browse files Browse the repository at this point in the history
  • Loading branch information
magicdict committed Oct 26, 2016
1 parent a8b8778 commit 79babee
Show file tree
Hide file tree
Showing 19 changed files with 224 additions and 117 deletions.
4 changes: 0 additions & 4 deletions MongoCola/MongoCola.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@
<Project>{E71AF267-0DFD-4E71-94A7-48F40793CEEF}</Project>
<Name>MongoGUIView</Name>
</ProjectReference>
<ProjectReference Include="..\PlugInPackage\PlugInPackage.csproj">
<Project>{0D765082-CFF4-4BDC-8106-9281DA9D0BB4}</Project>
<Name>PlugInPackage</Name>
</ProjectReference>
<ProjectReference Include="..\PlugInPrj\PlugInPrj.csproj">
<Project>{7A3EA89C-F84E-446C-892A-690FA28BEBCA}</Project>
<Name>PlugInPrj</Name>
Expand Down
4 changes: 2 additions & 2 deletions MongoCola/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
[assembly: AssemblyVersion("2.0.2.0")]
[assembly: AssemblyFileVersion("2.0.2.0")]
3 changes: 3 additions & 0 deletions MongoCola/Release Note_Ver2.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ CSharp Mongo Driver 2.4.0-beta1
2. 视图的展示(From MongoDB 3.4)
3. BsonInt64,BSonDecimal128 的对应
4. 有视图的时候,状态窗体的对应
5. GFS拖曳上传功能

###修改
1. 新建数据集的BUG修正,数据集验证的修复
2. 新建文档时候出现的无法通过数据集验证的异常处理
3. 数据库必须有一个数据集,如果没有数据集的话,则数据库会被回收掉,所以新建数据库的时候,可以指定初始数据集的名称
4. 修正了无法保存配置的严重错误!(感谢错误报告者: https://github.com/shipf0820)
5. ML插件化
6. 修正了切断连接无效的问题
7. NetCore和Net版本条件编译

###聚合
1. $indexStats $stage,$sortByCount(From MongoDB3.4), $sample, $unwind
Expand Down
15 changes: 9 additions & 6 deletions MongoCola/frmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions MongoCola/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private void frmMain_Load(object sender, EventArgs e)
serverStatusCtl.IsFixedItem = true;
serverStatusCtl.SelectObjectTag = "[ServerStatus]";
serverStatusCtl.BindingMenu = StatusToolStripMenuItem;
MultiTabManger.AddView(serverStatusCtl, "Status");
MultiTabManger.AddView(serverStatusCtl, "Status",string.Empty);

//刷新
RefreshToolStripMenuItem_Click(sender, e);
Expand Down Expand Up @@ -485,6 +485,7 @@ private void ViewDataRecord()
{
case ConstMgr.GridFileSystemTag:
dataViewctl = new CtlGfsView(mDataViewInfo);
dataViewctl.AllowDrop = true;
break;
case ConstMgr.UserListTag:
dataViewctl = new CtlUserView(mDataViewInfo);
Expand All @@ -501,7 +502,7 @@ private void ViewDataRecord()
dataViewctl.MDataViewInfo = mDataViewInfo;
dataViewctl.SelectObjectTag = RuntimeMongoDbContext.SelectObjectTag;
dataViewctl.ParentMenu = CollectionToolStripMenuItem;
MultiTabManger.AddView(dataViewctl, RuntimeMongoDbContext.GetCurrentCollectionName());
MultiTabManger.AddView(dataViewctl, RuntimeMongoDbContext.GetCurrentCollectionName(), RuntimeMongoDbContext.SelectTagType);
}

/// <summary>
Expand Down
3 changes: 0 additions & 3 deletions MongoColaWebAdmin/Utility.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace MongoColaWebAdmin
{
Expand Down
2 changes: 1 addition & 1 deletion MongoGUICtl/ClientTree/FillMongoDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static void FillCollectionStatusToList(CtlTreeViewColumns lstData,
var collectionStatus = mongoDb.GetCollection(strColName).GetStats();
dbStatusList.Add(collectionStatus.Response);
}
catch (Exception ex)
catch (Exception)
{

}
Expand Down
8 changes: 5 additions & 3 deletions MongoGUIView/MultiTabManger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using MongoUtility.Basic;
using System;
using System.Collections.Generic;
using System.Windows.Forms;

Expand Down Expand Up @@ -71,7 +72,7 @@ public static void Init(TabControl mViewTabContain, List<ToolStripMenuItem> mPar
/// <param name="key"></param>
/// <param name="info"></param>
/// <param name="tab"></param>
public static void AddView(MultiTabControl view, string tabPageTitle)
public static void AddView(MultiTabControl view, string tabPageTitle,string SelectTagType)
{
var key = view.SelectObjectTag;
if (ExistTabPage.ContainsKey(key))
Expand All @@ -80,6 +81,7 @@ public static void AddView(MultiTabControl view, string tabPageTitle)
return;
}
var tabpage = new TabPage();
if (SelectTagType == ConstMgr.GridFileSystemTag) tabpage.AllowDrop = true;
if (view.IsFixedItem)
{
if (!BindingMenuItems.ContainsKey(key))
Expand All @@ -102,7 +104,7 @@ public static void AddView(MultiTabControl view, string tabPageTitle)
{
//加入
view.RefreshGui();
AddView(view, tabPageTitle);
AddView(view, tabPageTitle, SelectTagType);
}
else
{
Expand Down
6 changes: 5 additions & 1 deletion MongoGUIView/ctlGFSView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 61 additions & 1 deletion MongoGUIView/ctlGFSView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public CtlGfsView(DataViewInfo dataViewInfo)

private void ctlGFSView_Load(object sender, EventArgs e)
{

lstData.AllowDrop = true;
tabDataShower.AllowDrop = true;
AllowDrop = true;

OpenFileToolStripMenuItem.Click += OpenFileStripButton_Click;
DownloadFileToolStripMenuItem.Click += DownloadFileStripButton_Click;
UploadFileToolStripMenuItem.Click += UploadFileStripButton_Click;
Expand All @@ -53,7 +58,7 @@ private void ctlGFSView_Load(object sender, EventArgs e)
UploadFolderToolStripMenuItem.Enabled = true;

cmbListViewStyle.Visible = true;
cmbListViewStyle.SelectedIndexChanged += (x, y) => { lstData.View = (View) cmbListViewStyle.SelectedIndex; };
cmbListViewStyle.SelectedIndexChanged += (x, y) => { lstData.View = (View)cmbListViewStyle.SelectedIndex; };
}

private void lstData_SelectedIndexChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -107,11 +112,63 @@ private void lstData_SelectedIndexChanged(object sender, EventArgs e)
}
}

/// <summary>
/// 双击操作
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lstData_MouseDoubleClick(object sender, MouseEventArgs e)
{
OpenFileStripButton_Click(sender, e);
}

/// <summary>
/// 拖曳终止
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void lstData_DragDrop(object sender, DragEventArgs e)
{
Array UploadfileList = (Array)e.Data.GetData(DataFormats.FileDrop);
if (!MyMessageBox.ShowConfirm("UploadFile", "是否上传" + UploadfileList.Length + "个文件")) return;
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 count = 0;
foreach (string UploadFilename in UploadfileList)
{
if (File.Exists(UploadFilename))
{
Gfs.UpLoadFile(UploadFilename, opt, RuntimeMongoDbContext.GetCurrentDataBase());
count++;
}
else
{
if (Directory.Exists(UploadFilename))
{
var uploadDir = new DirectoryInfo(UploadFilename);
UploadFolder(uploadDir, ref count, opt);
}
}
}
RefreshGui();
MyMessageBox.ShowMessage("Upload", "Upload Completed! Upload Files Count: " + count);
}

/// <summary>
/// 开始拖曳
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void lstData_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
}

protected void lstData_MouseClick(object sender, MouseEventArgs e)
{
RuntimeMongoDbContext.SelectObjectTag = MDataViewInfo.StrDbTag;
Expand Down Expand Up @@ -275,6 +332,9 @@ public void DeleteFileStripButton_Click(object sender, EventArgs e)
}
}


#endregion


}
}
28 changes: 14 additions & 14 deletions MongoGUIView/ctlGFSView.resx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<data name="UploadFileToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAFzUkdCAK7O
HOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAAsPAAALDwGS+QOlAAAAHHRFWHRTb2Z0d2FyZQBBZG9i
HOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAAsMAAALDAE/QCLIAAAAHHRFWHRTb2Z0d2FyZQBBZG9i
ZSBGaXJld29ya3MgQ1MzmNZGAwAAABV0RVh0Q3JlYXRpb24gVGltZQAyLzE3LzA4IJyqWAAABBF0RVh0
WE1MOmNvbS5hZG9iZS54bXAAPD94cGFja2V0IGJlZ2luPSIgICAiIGlkPSJXNU0wTXBDZWhpSHpyZVN6
TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRv
Expand Down Expand Up @@ -212,12 +212,12 @@
<data name="DownloadFileStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEjSURBVDhPrZOxTsMwEIbzJvAGzSN4RF3IWCEhPLLhsVs7
stUjTLkxG16QOnpk9NiNG9nqke24c2KaEEBG4pd+RbLuvv/upFTOI/UOyeAC7R6fmqpU0jwWOE/1habF
8qYeSn6XpI5lO0/+JZBqTBnE7acAmQAYIt9mZWgo+1lS+J3iO5EqAnDaTNyMb7Fwgi8ASY4xEiIDtOFV
kO/SG/Y4B1o4AT6bOT0DpAaeMRqLtAUkvfZ0dtmep2ZRBqQmdjhg74CTFZyP8dr2IGX8aRILLh1LLInZ
+W0oS9IyRRcZEOarlEjf/wPAAANuRyuUyDzwPbZ8QF5B2x5Qr4DqBspAd7tXlcdPAF5BAIurtux/EW26
o5FktZZm97fmrE17NNPkqvoAsC5qldEuvNMAAAAASUVORK5CYII=
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEiSURBVDhPrZOxTsMwEIbzJvAGzSN4RF3IWCEhPLLhsVs7
stUjTLkxGxZTR4+MHrtxI1s9sh13TkwTAshI/NKvSNbd99+dlMp5pN4hGVyg3eNTU5VKmscC56m+0LRY
3tRDye+S1LFs58m/BFKNKYO4/RQgEwBD5NusDA1lP0sKv1N8J1JFAE6biZvxLRZO8AUgyTFGQmSANrwK
8l16wx7nQAsnwGczp2eA1MAzRmORtoCk157OLtvz1CzKgNTEDgfsHXCygvMxXtsepIw/TWLBpWOJJTE7
vw1lSVqm6CIDwnyVEun7fwAYYMDtaIUSmQe+x5YPyCto2wPqFVDdQBnobveq8vgJwCsIYHHVlv0vok13
NJKs1tLs/tactWmPZppcVR+pxWqSACpbGwAAAABJRU5ErkJggg==
</value>
</data>
<data name="UpLoadFolderStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
Expand All @@ -237,24 +237,24 @@
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFDSURBVDhPlZG9SsRQEIUnPoVg5QuI+AJaCpZbWlj6BpY+
gqVdcBtrQV1cXMNCGhXEiIgBWYtIiEmMEEP+m3Hn3iR7k40/GfjI3JlzzoUb+K0WzyQkimO3IuPJFzA6
h5Dh2Ac8dDnU/zuEhAcfwNg3OeX5zxAS7FlQsTvhiLPWkH5f1mixY0CN3jOnOS9CFrh7Wopyhds3W2xR
sjm9eeNeYlAv7tZPVz49z+sVdh6Q53kFidZ0wNVriUE9zcpSVRUVRRkX9vaApUfA5bHEoF4MoBoMzmdv
0RbQhm3baFkWuq6Lw+HFzwFNsizDJEkwDEMMgoB9R6PL+YD3N32G0UDYkZY8hZ1+4xGmaVoRxzG7RYRm
ooY8hZ0HRFGExuQBX/U7xsvTbY1yThrSzgX4vo+O41SYpllD3JG2ESBrNOiGrAEAfAMR9x29JiTcEAAA
gqVVwG2sRXRxcQ0LaVQQIyIGZC0iISYxQgz5b8ade5PsTTb+ZOAjc2fOORdu4LdaPJOQKI7diownX8Do
HEKGYx/w0OVQ/+8QEh58AGPf5JTnP0NIsGdBxe6EI85aQ/p9WaPFjgE1es+c5rwIWeDuaSnKFW7fbLFF
yeb05o17iUG9uFs/Xfn0PK9X2HlAnucVJFrTAVevJQb1NCtLVVVUFGVc2NsDlh4Bl8cSg3oxgGowOJ+9
RVtAG7Zto2VZ6LouDocXPwc0ybIMkyTBMAwxCAL2HY0u5wPe3/QZRgNhR1ryFHb6jUeYpmlFHMfsFhGa
iRryFHYeEEURGpMHfNXvGC9PtzXKOWlIOxfg+z46jlNhmmYNcUfaRoCs0aAbsgYA8A0Mnx25D2RMXwAA
AABJRU5ErkJggg==
</value>
</data>
<data name="OpenFileStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGASURBVDhPvZEhU8MwFMf7CaASBXGgWCWGu8q5RWK41THF
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGASURBVDhPvZEhU8MwFMf7CaASBXGgWCV3mMq5RWK41THF
Koda5FCLY65xzBE5WTkZiaxE5hv8eS/JoINxh+B4d7+7XJrf/70m2b/U/KkplTZQC2JlMV82Kn36XVUz
jdHdsuL1dN7kHDZ9bCTvZy/rpbRrja/Qvg72gZo+NFJONJiMD3fOwHsbgDfAm4E1FPI8PzjqTo4BdNCT
1JcDrzUMfTMrFdEKmlnUSDmxQgALe7IiqoN8C+AuISDRWh34uA+jAv1JwjSLNA1v+k4HudvSYZLQ0QQ/
Qb/GuLXEdDwynwEEy+2G1uFQb3THSGAr4TclOlPg/vbaU0CR8Tie/nmvu0sBQSRYbMsge1tATQTGw6P4
zCHARdm1qXtPRBu7sujXBdwiRzUUGJwfixDAl+Hafvck7romsTMCTueh++XFqQ0yF98kP6WzdDE6+6Bl
qJtVETMT0LWI3QdnMukxQKsKakbUEnUlUd2UkMMS5VWBohAohIA4yZHnOQSR1L+oLHsHsBDl3AhenBgA
qJtVETMT0LWI3QdnMukxQKsKakbUEnUlUd2UkMMS5VWBohAohIA4yZHnOQSR1L+oLHsHrPjl2viy7T4A
AAAASUVORK5CYII=
</value>
</data>
Expand Down
3 changes: 2 additions & 1 deletion MongoGUIView/frmGFSOption.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 79babee

Please sign in to comment.