private bool SetRecordFolder(GDMRecord record, string folder) { if (record != null && FoldersHelper.HasFolderSupport(record.RecordType)) { FoldersHelper.SetFolder(record, folder); return(true); } return(false); }
private bool FilterHandler(GDMRecord record) { bool result = true; try { if (!string.IsNullOrEmpty(fFilterFolder) && FoldersHelper.HasFolderSupport(record.RecordType)) { result = fFilterFolder.Equals(FoldersHelper.GetFolder(record)); } } catch (Exception ex) { Logger.WriteError("FoldersWidget.FilterHandler()", ex); } return(result); }
private void CollectData() { int num = fBase.Context.Tree.RecordsCount; for (int i = 0; i < num; i++) { GDMRecord rec = fBase.Context.Tree[i]; if (FoldersHelper.HasFolderSupport(rec.RecordType)) { string folder = FoldersHelper.GetFolder(rec); if (!string.IsNullOrEmpty(folder)) { fFolders.Add(folder); } } } }
private void UpdateButtons(IBaseWindow baseWin) { if (baseWin != null) { var recType = baseWin.GetSelectedRecordType(); var hasFS = FoldersHelper.HasFolderSupport(recType); var selectedRecord = baseWin.GetSelectedRecordEx(); int treeRecords = fBase.Context.Tree.RecordsCount; int selRecords = fBase.GetContentList(recType).Count; btnSetFilter.Enabled = hasFS; btnSetCurrent.Enabled = hasFS && (selectedRecord != null); btnSetSelected.Enabled = hasFS && (selRecords > 0); btnSetAll.Enabled = hasFS && (treeRecords > 0); } }