static void ChangesetsListViewItemGUI( ViewQueryResult queryResult, float rowHeight, ChangesetListViewItem item, RowGUIArgs args, bool isBoldText, Action avatarLoadedAction) { for (int visibleColumnIdx = 0; visibleColumnIdx < args.GetNumVisibleColumns(); visibleColumnIdx++) { Rect cellRect = args.GetCellRect(visibleColumnIdx); if (visibleColumnIdx == 0) { cellRect.x += UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT; cellRect.width -= UnityConstants.FIRST_COLUMN_WITHOUT_ICON_INDENT; } ChangesetsListColumn column = (ChangesetsListColumn)args.GetColumn(visibleColumnIdx); ChangesetsListViewItemCellGUI( cellRect, rowHeight, queryResult, item, column, avatarLoadedAction, args.selected, args.focused, isBoldText); } }
public void ShouldReturnNullIfCountIsZeroForTypedViewQueryResult() { var result = new ViewQueryResult <object>( new ViewQuery(), new ViewResultRow[0], count: 0, totalCount: 3, offset: 0, rowConvertor: StubConvertor); Assert.Null(result.NextPageQuery); }
public void ShouldReturnNullIfTotalCountAndCountAreEqualForTypedViewQueryResult() { var result = new ViewQueryResult <object>( new ViewQuery(), new ViewResultRow[3], totalCount: 3, offset: 0, rowConvertor: StubConvertor); Assert.Null(result.NextPageQuery); }
public ActionResult UCProductReviewList(string PageIndex, string PageSize, string SearchType, string ProductSysNo, string ProductGroupSysNo) { Product_ReviewQueryInfo queryInfo = new Product_ReviewQueryInfo(); queryInfo.NeedReplyCount = 5; queryInfo.PagingInfo = new PageInfo(); int tempIndex = 0; if (int.TryParse(PageIndex, out tempIndex)) { queryInfo.PagingInfo.PageIndex = tempIndex; } int tempSize = 0; if (int.TryParse(PageSize, out tempSize)) { queryInfo.PagingInfo.PageSize = tempSize; } int tempSearchType = 0; if (!string.IsNullOrWhiteSpace(SearchType)) { var searchTypeArray = SearchType.Split(new char[] { '+' }, StringSplitOptions.RemoveEmptyEntries); queryInfo.SearchType.Clear(); foreach (string searchType in searchTypeArray) { if (int.TryParse(searchType, out tempSearchType)) { queryInfo.SearchType.Add((ReviewScoreType)tempSearchType); } } } int tempProductSysNo = 0; if (int.TryParse(ProductSysNo, out tempProductSysNo)) { queryInfo.ProductSysNo = tempProductSysNo; } int tempProductGroupSysNo = 0; if (int.TryParse(ProductGroupSysNo, out tempProductGroupSysNo)) { queryInfo.ProductGroupSysNo = tempProductGroupSysNo; } Product_ReviewList list = ReviewFacade.GetProductReviewListByProductGroupSysNoForProduct(queryInfo); ViewQueryResult <Product_ReviewDetail> result = new ViewQueryResult <Product_ReviewDetail>(); result.ResultList = list.ProductReviewDetailList.CurrentPageData; result.PagingInfo.PageIndex = list.ProductReviewDetailList.PageNumber - 1; result.PagingInfo.PageSize = list.ProductReviewDetailList.PageSize; result.PagingInfo.TotalCount = list.ProductReviewDetailList.TotalRecords; return((ActionResult)View(result)); }
void FillBranches(WorkspaceInfo wkInfo, string query, List <RepObjectInfo> branchesToSelect) { if (mIsRefreshing) { return; } mIsRefreshing = true; int defaultRow = TableViewOperations. GetFirstSelectedRow(mBranchesListView); ((IProgressControls)mProgressControls).ShowProgress( PlasticLocalization.GetString( PlasticLocalization.Name.LoadingBranches)); ViewQueryResult queryResult = null; IThreadWaiter waiter = ThreadWaiter.GetWaiter(); waiter.Execute( /*threadOperationDelegate*/ delegate { queryResult = new ViewQueryResult( PlasticGui.Plastic.API.FindQuery(wkInfo, query)); }, /*afterOperationDelegate*/ delegate { try { if (waiter.Exception != null) { ExceptionsHandler.DisplayException(waiter.Exception); return; } UpdateBranchesList( mBranchesListView, queryResult); int branchesCount = GetBranchesCount(queryResult); if (branchesCount == 0) { return; } BranchesSelection.SelectBranches( mBranchesListView, branchesToSelect, defaultRow); } finally { ((IProgressControls)mProgressControls).HideProgress(); mIsRefreshing = false; } }); }
internal void BuildModel( ViewQueryResult queryResult, long loadedChangesetId) { mListViewItemIds.Clear(); mQueryResult = queryResult; mLoadedChangesetId = loadedChangesetId; }
static int GetChangesetsCount( ViewQueryResult queryResult) { if (queryResult == null) { return(0); } return(queryResult.Count()); }
internal static int GetBranchesCount( ViewQueryResult queryResult) { if (queryResult == null) { return(0); } return(queryResult.Count()); }
static void UpdateChangesetsList( ChangesetsListView changesetsListView, ViewQueryResult queryResult) { changesetsListView.BuildModel(queryResult); changesetsListView.Refilter(); changesetsListView.Sort(); changesetsListView.Reload(); }
static void UpdateBranchesList( BranchesListView branchesListView, ViewQueryResult queryResult) { branchesListView.BuildModel( queryResult); branchesListView.Refilter(); branchesListView.Sort(); branchesListView.Reload(); }
public void ShouldReturnNextPageQueryCopingLimitForViewQueryResultAndRangeKeyQuery() { var result = new ViewQueryResult <object>( ViewQuery.Parse("_design/dd/_view/pointOfView?startkey=%22first%22&endkey=%22third%22&limit=2"), new[] { new ViewResultRow("first".ToJsonFragment(), null, null, null), new ViewResultRow("second".ToJsonFragment(), null, null, null) }, totalCount: 3, offset: 0, rowConvertor: StubConvertor); Assert.Equal(2, result.NextPageQuery.Limit); }
public void ShouldReturnNextPageQueryCopingLimitForViewQueryResultAndRangeKeyQuery() { var result = new ViewQueryResult<object>( ViewQuery.Parse("_design/dd/_view/pointOfView?startkey=%22first%22&endkey=%22third%22&limit=2"), new[] { new ViewResultRow("first".ToJsonFragment(), null, null, null), new ViewResultRow("second".ToJsonFragment(), null, null, null) }, totalCount: 3, offset: 0, rowConvertor: StubConvertor); Assert.Equal(2, result.NextPageQuery.Limit); }
static void ChangesetsListViewItemCellGUI( Rect rect, ViewQueryResult queryResult, ChangesetListViewItem item, ChangesetsListColumn column, bool isSelected, bool isFocused) { string columnText = RepObjectInfoView.GetColumnText( queryResult.GetRepositorySpec(item.ObjectInfo), queryResult.GetRepObjectInfo(item.ObjectInfo), ChangesetsListHeaderState.GetColumnName(column)); DefaultGUI.Label( rect, columnText, isSelected, isFocused); }
static void ChangesetsListViewItemCellGUI( Rect rect, float rowHeight, ViewQueryResult queryResult, ChangesetListViewItem item, ChangesetsListColumn column, Action avatarLoadedAction, bool isSelected, bool isFocused, bool isBoldText) { string columnText = RepObjectInfoView.GetColumnText( queryResult.GetRepositorySpec(item.ObjectInfo), queryResult.GetRepObjectInfo(item.ObjectInfo), ChangesetsListHeaderState.GetColumnName(column)); if (column == ChangesetsListColumn.CreatedBy) { DrawTreeViewItem.ForItemCell( rect, rowHeight, -1, GetAvatar.ForEmail(columnText, avatarLoadedAction), null, columnText, isSelected, isFocused, isBoldText, false); return; } if (column == ChangesetsListColumn.Branch || column == ChangesetsListColumn.Repository || column == ChangesetsListColumn.Guid) { DrawTreeViewItem.ForSecondaryLabel( rect, columnText, isSelected, isFocused, isBoldText); return; } DrawTreeViewItem.ForLabel( rect, columnText, isSelected, isFocused, isBoldText); }
public void ShouldReturnNextPageQueryForViewQueryResultAndRangeKeyQuery() { var result = new ViewQueryResult<object>( ViewQuery.Parse("_design/dd/_view/pointOfView?startkey=%22first%22&endkey=%22third%22"), new [] { new ViewResultRow("first".ToJsonFragment(), null, null, null), new ViewResultRow("second".ToJsonFragment(), null, null, null) }, totalCount: 3, offset: 0, rowConvertor: StubConvertor); var nextPageQuery = result.NextPageQuery; Assert.Equal("second".ToJsonFragment(), nextPageQuery.StartKey); Assert.Null(nextPageQuery.StartDocumentId); Assert.Equal(1, nextPageQuery.Skip); }
public void ShouldReturnNextPageQueryForViewQueryResultAndRangeKeyQuery() { var result = new ViewQueryResult <object>( ViewQuery.Parse("_design/dd/_view/pointOfView?startkey=%22first%22&endkey=%22third%22"), new [] { new ViewResultRow("first".ToJsonFragment(), null, null, null), new ViewResultRow("second".ToJsonFragment(), null, null, null) }, totalCount: 3, offset: 0, rowConvertor: StubConvertor); var nextPageQuery = result.NextPageQuery; Assert.Equal("second".ToJsonFragment(), nextPageQuery.StartKey); Assert.Null(nextPageQuery.StartDocumentId); Assert.Equal(1, nextPageQuery.Skip); }
public void ShouldReturnNextPageQueryMentioningStartDocIdForViewQueryResultAndKeyQuery() { var result = new ViewQueryResult <object>( ViewQuery.Parse("_design/dd/_view/pointOfView?key=%22keyvalue%22"), new [] { new ViewResultRow("keyvalue".ToJsonFragment(), null, "firstDocId", null), new ViewResultRow("keyvalue".ToJsonFragment(), null, "secondDocId", null) }, totalCount: 3, offset: 0, rowConvertor: StubConvertor); var nextPageQuery = result.NextPageQuery; Assert.Null(nextPageQuery.StartKey); Assert.Null(nextPageQuery.EndKey); Assert.Equal("keyvalue".ToJsonFragment(), nextPageQuery.Key); Assert.Equal("secondDocId", nextPageQuery.StartDocumentId); Assert.Equal(1, nextPageQuery.Skip); }
internal void ShowBranchesViewIfNeeded() { if (!BoolSetting.Load(UnityConstants.SHOW_BRANCHES_VIEW_KEY_NAME, true)) { return; } string query = QueryConstants.BranchesBeginningQuery; ViewQueryResult queryResult = null; IThreadWaiter waiter = ThreadWaiter.GetWaiter(); waiter.Execute( /*threadOperationDelegate*/ delegate { queryResult = new ViewQueryResult( PlasticGui.Plastic.API.FindQuery(mWkInfo, query)); }, /*afterOperationDelegate*/ delegate { if (waiter.Exception != null) { ExceptionsHandler.DisplayException(waiter.Exception); return; } if (queryResult == null) { return; } if (queryResult.Count() > 0) { OpenBranchesTab(); } }); }
public void ShouldReturnNextPageQueryMentioningStartDocIdForViewQueryResultAndKeyQuery() { var result = new ViewQueryResult<object>( ViewQuery.Parse("_design/dd/_view/pointOfView?key=%22keyvalue%22"), new [] { new ViewResultRow("keyvalue".ToJsonFragment(), null, "firstDocId", null), new ViewResultRow("keyvalue".ToJsonFragment(), null, "secondDocId", null) }, totalCount: 3, offset: 0, rowConvertor: StubConvertor); var nextPageQuery = result.NextPageQuery; Assert.Null(nextPageQuery.StartKey); Assert.Null(nextPageQuery.EndKey); Assert.Equal("keyvalue".ToJsonFragment(), nextPageQuery.Key); Assert.Equal("secondDocId", nextPageQuery.StartDocumentId); Assert.Equal(1, nextPageQuery.Skip); }
public void ShouldReturnNullIfTotalCountAndCountAreEqualForUntypedViewQueryResult() { var result = new ViewQueryResult(new ViewQuery(), new ViewResultRow[3], totalCount: 3, offset: 0); Assert.Null(result.NextPageQuery); }
void FillChangesets(WorkspaceInfo wkInfo, string query) { if (mIsRefreshing) { return; } mIsRefreshing = true; List <RepObjectInfo> changesetsToSelect = ChangesetsSelection.GetSelectedRepObjectInfos(mChangesetsListView); int defaultRow = TableViewOperations. GetFirstSelectedRow(mChangesetsListView); ((IProgressControls)mProgressControls).ShowProgress( PlasticLocalization.GetString( PlasticLocalization.Name.LoadingChangesets)); long loadedChangesetId = -1; ViewQueryResult queryResult = null; IThreadWaiter waiter = ThreadWaiter.GetWaiter(); waiter.Execute( /*threadOperationDelegate*/ delegate { queryResult = new ViewQueryResult( PlasticGui.Plastic.API.FindQuery(wkInfo, query)); loadedChangesetId = GetLoadedChangesetId( wkInfo, mIsGluonMode); }, /*afterOperationDelegate*/ delegate { try { if (waiter.Exception != null) { ExceptionsHandler.DisplayException(waiter.Exception); return; } int changesetsCount = GetChangesetsCount(queryResult); mChangesetsLabelText = string.Format( PlasticLocalization.GetString(PlasticLocalization.Name.ChangesetsCount), changesetsCount); UpdateChangesetsList( mChangesetsListView, queryResult, loadedChangesetId); if (changesetsCount == 0) { mDiffPanel.ClearInfo(); return; } ChangesetsSelection.SelectChangesets( mChangesetsListView, changesetsToSelect, defaultRow); } finally { ((IProgressControls)mProgressControls).HideProgress(); mIsRefreshing = false; } }); }
public void ShouldReturnNullIfCountIsZeroForUntypedViewQueryResult() { var result = new ViewQueryResult(new ViewQuery(), new ViewResultRow[0], count: 0, totalCount: 3, offset: 0); Assert.Null(result.NextPageQuery); }
public void ShouldReturnNullIfCountIsZeroForTypedViewQueryResult() { var result = new ViewQueryResult<object>( new ViewQuery(), new ViewResultRow[0], count: 0, totalCount: 3, offset: 0, rowConvertor: StubConvertor); Assert.Null(result.NextPageQuery); }
public void ShouldReturnNullIfCountIsZeroForUntypedViewQueryResult() { var result = new ViewQueryResult(new ViewQuery(), new ViewResultRow[0], count: 0, totalCount: 3, offset: 0); Assert.Null(result.NextPageQuery); }
public void ShouldReturnNullIfTotalCountAndCountAreEqualForTypedViewQueryResult() { var result = new ViewQueryResult<object>( new ViewQuery(), new ViewResultRow[3], totalCount: 3, offset: 0, rowConvertor: StubConvertor); Assert.Null(result.NextPageQuery); }
internal void BuildModel(ViewQueryResult queryResult) { mListViewItemIds.Clear(); mQueryResult = queryResult; }
public void ShouldReturnNullIfTotalCountAndCountAreEqualForUntypedViewQueryResult() { var result = new ViewQueryResult(new ViewQuery(), new ViewResultRow[3], totalCount: 3, offset: 0); Assert.Null(result.NextPageQuery); }