Microsoft.Protocols.TestSuites.MS_VIEWSS.MS_VIEWSSSUTControlAdapter.GetItemsCount C# (CSharp) Method

GetItemsCount() public method

Implement the GetItemsCount method for getting the count of the list items in the specified view.
public GetItemsCount ( string listGuid, string viewGuid ) : int
listGuid string A specified list GUID in the server.
viewGuid string A specified view GUID in the server.
return int
        public int GetItemsCount(string listGuid, string viewGuid)
        {
            int itemCount = 0;
            try
            {
                GetListItemsResponseGetListItemsResult getItemsResult
                    = this.listProxy.GetListItems(listGuid, viewGuid, null, null, null, null, null);
                itemCount = getItemsResult.listitems.data.Any.Length;
            }
            catch (SoapException soapException)
            {
                this.Site.Log.Add(
                    LogEntryKind.Debug,
                    @"There is an exception generated when calling [GetItemsCount] method:\r\n{0}, check parameters are correct or not.",
                    soapException.Message);
                throw;
            }

            return itemCount;
        }