Пример #1
0
        public PartitioningVariables GetSearchSession(bool createNew = false)
        {
            PartitioningVariables searchSession = null;

            //Find free search session
            for (int i = 0; i < _partitioningSessions.Length; i++)
            {
                if (_partitioningSessions[i] != null)
                {
                    if (!_partitioningSessions[i].ExportSession)
                    {
                        searchSession = _partitioningSessions[i];
                        break;
                    }
                }
            }

            if (searchSession == null && createNew)
            {
                for (int i = 0; i < _partitioningSessions.Length; i++)
                {
                    if (_partitioningSessions[i] == null)
                    {
                        _partitioningSessions[i] = new PartitioningVariables();
                        searchSession            = _partitioningSessions[i];
                        break;
                    }
                }
            }

            return(searchSession);
        }
Пример #2
0
        public bool TryStartExport()
        {
            PartitioningVariables exportSession = GetExportSession();

            if (exportSession == null)
            {
                PartitioningVariables searchSession = GetSearchSession();

                if (searchSession != null)
                {
                    searchSession.ExportSession = true;
                    return(true);
                }
            }

            return(false);
        }
Пример #3
0
        public PartitioningVariables GetExportSession()
        {
            PartitioningVariables exportSession = null;

            //Find export session
            for (int i = 0; i < _partitioningSessions.Length; i++)
            {
                if (_partitioningSessions[i] != null)
                {
                    if (_partitioningSessions[i].ExportSession)
                    {
                        exportSession = _partitioningSessions[i];
                        break;
                    }
                }
            }

            return(exportSession);
        }