예제 #1
0
        /// <summary>
        ///     Create a DataView Tab
        /// </summary>
        private void ViewDataRecord()
        {
            //由于Collection 和 Document 都可以触发这个事件,所以,先把Tag以前的标题头去掉
            //Collectiong:XXXX 和 Document:XXXX 都统一成 XXXX
            var dataKey = RuntimeMongoDbContext.SelectTagData;
            if (MultiTabManger.IsExist(dataKey))
            {
                MultiTabManger.SelectTab(dataKey);
                return;
            }

            var mDataViewInfo = new DataViewInfo
            {
                StrDbTag = RuntimeMongoDbContext.SelectObjectTag,
                IsUseFilter = false,
                IsReadOnly = RuntimeMongoDbContext.CurrentMongoConnectionconfig.IsReadOnly,
                MDataFilter = new DataFilter()
            };

            CtlDataView dataViewctl;
            switch (RuntimeMongoDbContext.SelectTagType)
            {
                case ConstMgr.GridFileSystemTag:
                    dataViewctl = new CtlGfsView(mDataViewInfo);
                    break;
                case ConstMgr.UserListTag:
                    dataViewctl = new CtlUserView(mDataViewInfo);
                    break;
                default:
                    dataViewctl = new CtlDocumentView(mDataViewInfo);
                    break;
            }

            dataViewctl.MDataViewInfo = mDataViewInfo;
            dataViewctl.SelectObjectTag = RuntimeMongoDbContext.SelectObjectTag;
            dataViewctl.ParentMenu = CollectionToolStripMenuItem;
            MultiTabManger.AddView(dataViewctl, RuntimeMongoDbContext.GetCurrentCollectionName());
        }
예제 #2
0
        /// <summary>
        ///     Create a DataView Tab
        /// </summary>
        private void ViewDataRecord()
        {
            //由于Collection 和 Document 都可以触发这个事件,所以,先把Tag以前的标题头去掉
            //Collectiong:XXXX 和 Document:XXXX 都统一成 XXXX
            var dataKey = RuntimeMongoDbContext.SelectTagData;
            if (MultiTabManger.IsExist(dataKey))
            {
                MultiTabManger.SelectTab(dataKey);
                return;
            }

            var mDataViewInfo = new DataViewInfo
            {
                strCollectionPath = RuntimeMongoDbContext.SelectObjectTag,
                IsReadOnly = RuntimeMongoDbContext.CurrentMongoConnectionconfig.IsReadOnly,
            };

            CtlDataView dataViewctl;
            switch (RuntimeMongoDbContext.SelectTagType)
            {
                case ConstMgr.GridFileSystemTag:
                    dataViewctl = new CtlGfsView(mDataViewInfo);
                    dataViewctl.AllowDrop = true;
                    break;
                case ConstMgr.UserListTag:
                    dataViewctl = new CtlUserView(mDataViewInfo);
                    break;
                case ConstMgr.ViewTag:
                    mDataViewInfo.IsView = true;
                    dataViewctl = new CtlDocumentView(mDataViewInfo);
                    break;
                default:
                    dataViewctl = new CtlDocumentView(mDataViewInfo);
                    break;
            }

            dataViewctl.mDataViewInfo = mDataViewInfo;
            dataViewctl.SelectObjectTag = RuntimeMongoDbContext.SelectObjectTag;
            dataViewctl.ParentMenu = CollectionToolStripMenuItem;
            var TabTitle = UiHelper.GetShowName(RuntimeMongoDbContext.GetCurrentDataBaseName(),RuntimeMongoDbContext.GetCurrentCollectionName());
            MultiTabManger.AddView(dataViewctl, TabTitle, RuntimeMongoDbContext.SelectTagType);
        }