当前位置: 首页>>代码示例>>C#>>正文


C# ListViewItem.Count方法代码示例

本文整理汇总了C#中System.Windows.Forms.ListViewItem.Count方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewItem.Count方法的具体用法?C# ListViewItem.Count怎么用?C# ListViewItem.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ListViewItem的用法示例。


在下文中一共展示了ListViewItem.Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: threadFunctionQuery

        public void threadFunctionQuery(object uncast)
        {
            #region -instances

            DataTable dataTableDetails = new DataTable();
            int speedLimit;

            Hashtable hashTable = (Hashtable)uncast;
            Query query = new Query(database);

            Tracker tracker = (Tracker)hashTable["tracker"];
            if (tracker != null)
                speedLimit = tracker.SpeedLimit;

            TabControl tabControl = (TabControl)hashTable["tabControl"];

            DateTime dateTimeFrom = (DateTime)hashTable["dateTimeFrom"];
            DateTime dateTimeTo = (DateTime)hashTable["dateTimeTo"];
            List<Tracker> trackerList = (List<Tracker>)hashTable["trackerList"];

            int limit = (int)hashTable["limit"];
            int offset = (int)hashTable["offset"];

            int userId = (int)hashTable["comboBoxAccountId"];

            int dataCount = 0;

            string comboBoxReportTypeText = (string)hashTable["comboBoxReportTypeItem"];
            ReportType reportType = (ReportType)Enum.Parse(typeof(ReportType), comboBoxReportTypeText);

            bool tabPageExist = false;
            string tabPageName = "";
            string reportItemName = (string)hashTable["reportItemName"];
            string reportTypeName = Enum.GetName(typeof(ReportType), reportType);

            bool pagingStatus = false;
            #endregion
            #region -loop
            //If timeout we will query again up to 3 times
            for (int count = 0; count < 3; count++) {
                try {
                    #region checkTabPage
                    tabPageName = reportTypeName + " : " + reportItemName;
                    this.Invoke(new MethodInvoker(delegate {
                        foreach (TabPage tabPageItem in tabControl.TabPages) {
                            if (tabPageItem.Text == tabPageName) {
                                tabControl.SelectedTab = tabPageItem;
                                tabPageExist = true;
                                break;
                            }
                        }
                    }));

                    if (tabPageExist == true) {
                        break;
                    }
                    #endregion
                    #region querySelection
                    switch (reportType) {
                        case ReportType.HISTORICAL:
                            dataTableDetails = query.getTrackerHistoricalData(this.company, this.user, dateTimeFrom, dateTimeTo, limit, offset, tracker);
                            dataCount = query.getTrackerHistoricalDataCount(this.user, dateTimeFrom, dateTimeTo, tracker);
                            //dataTableDetails.writeToCsvFile(Directory.GetCurrentDirectory());
                            pagingStatus = true;
                            break;
                        case ReportType.IDLING:
                            dataTableDetails = query.getTrackerIdlingData(this.company, this.user, dateTimeFrom, dateTimeTo, 1000000, 0, tracker);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.RUNNING:
                            dataTableDetails = query.getTrackerRunningData(this.company, this.user, dateTimeFrom, dateTimeTo, 1000000, 0, tracker);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.GEOFENCE:
                            dataTableDetails = query.getTrackerGeofence(this.company, this.user, dateTimeFrom, dateTimeTo, 1000000, 0, tracker);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.TRACKERS:
                            dataTableDetails = query.getTrackers(this.company);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.ACC:
                            dataTableDetails = query.getTrackerAccData(this.company, this.user, dateTimeFrom, dateTimeTo, 1000000, 0, tracker);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.EXTERNAL_POWER_CUT:
                            dataTableDetails = query.getTrackerExternalPowerCutData(this.company, this.user, dateTimeFrom, dateTimeTo, 1000000, 0, tracker);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.OVERSPEED:
                            dataTableDetails = query.getTrackerOverSpeedData(this.company, this.user, dateTimeFrom, dateTimeTo, 1000000, 0, tracker);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.TRACKERS_GEOFENCE:
                            dataTableDetails = query.getTrackersGeofence(this.company, this.user, dateTimeFrom, dateTimeTo, 1000000, 0, trackerList);
                            dataCount = dataTableDetails.Rows.Count;
                            break;
                        case ReportType.TRACKERS_HISTORICAL:
                            dataTableDetails = query.getTrackersHistorical(this.company, this.user, dateTimeFrom, dateTimeTo, 500, 0, trackerList);
                            dataCount = dataTableDetails.Rows.Count;
//.........这里部分代码省略.........
开发者ID:rhalf,项目名称:AtsTqatProReportingTool,代码行数:101,代码来源:FormMain.cs


注:本文中的System.Windows.Forms.ListViewItem.Count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。