Esempio n. 1
0
        public void RefreshMainWindow()
        {
            ToDo.Clear();
            Doing.Clear();
            Backlog.Clear();
            Done.Clear();

            var result = readDbDataToDisplay();

            foreach (var i in result)
            {
                if (i.States == BackLog.State.IsToDo)
                {
                    ToDo.Add(i);
                }
                else if (i.States == BackLog.State.IsDoing)
                {
                    Doing.Add(i);
                }
                else if (i.States == BackLog.State.Backlog)
                {
                    Backlog.Add(i);
                }
                else
                {
                    Done.Add(i);
                }
            }
        }
Esempio n. 2
0
        public async Task RunAsync(Version vsVersion, IVsExtensionRepository repository, IVsExtensionManager manager, CancellationToken cancellationToken)
        {
            _log.Debug("RunAsync started");
            IEnumerable <ExtensionEntry> toUninstall = GetExtensionsMarkedForDeletion(vsVersion);
            IEnumerable <ExtensionEntry> toInstall   = GetMissingExtensions(manager).Except(toUninstall);

            int actions = toUninstall.Count() + toInstall.Count();

            if (actions > 0)
            {
                _progress = new Progress(actions);

                await UninstallAsync(toUninstall, repository, manager, cancellationToken).ConfigureAwait(false);

                var installationResult = await InstallAsync(toInstall, repository, manager, cancellationToken).ConfigureAwait(false);

                _log.Debug("Installation Completed ");
                _logger.Log(Environment.NewLine + _settings.ResourceProvider.InstallationComplete + Environment.NewLine);
                Done?.Invoke(this, installationResult);
            }
            else
            {
                _log.Debug("No actions to do");
            }
            _log.Debug("RunAsync ended");
        }
Esempio n. 3
0
 /// <summary>
 /// Add the retrieved data to the datatable
 /// </summary>
 /// <param name="data"></param>
 /// <param name="request"></param>
 public void HandInAssignment(string data, TableMetadata request)
 {
     HandInAssignment_m.WaitOne();
     Data[request] = data;
     Done.Add(request);
     HandInAssignment_m.ReleaseMutex();
 }
Esempio n. 4
0
        private async void OnSave()
        {
            var editingCompany = Mapper.Map <EditableCompany, Company>(Company);

            editingCompany.RelatedPeople = RelatedPersonListViewModel.RelatedPeople;

            try
            {
                if (EditMode)
                {
                    await _companiesService.UpdateCompanyAsync(editingCompany);
                }
                else
                {
                    await _companiesService.AddCompanyAsync(editingCompany);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                Company = null;
            }
        }
Esempio n. 5
0
 public void Clear()
 {
     ToDo.Clear();
     InProgress.Clear();
     Done.Clear();
     Cancelled.Clear();
 }
Esempio n. 6
0
 public void answer()
 {
     if (Sequence_Question < Question.Length - 1)
     {
         if (input_Answer.text == Answer [Sequence_Question])
         {
             Feed_Right.SetActive(false);
             Feed_Right.SetActive(true);
             Feed_False.SetActive(false);
             Score += 20;
         }
         else
         {
             Feed_Right.SetActive(false);
             Feed_False.SetActive(false);
             Feed_False.SetActive(true);
         }
         input_Answer.text = "";
         Displayed_Question();
     }
     else
     {
         if (input_Answer.text == Answer [Sequence_Question])
         {
             Score += 20;
         }
         Done.SetActive(true);
         Question_Spot.SetActive(false);
     }
 }
 void ReleaseDesignerOutlets()
 {
     if (Delete != null)
     {
         Delete.Dispose();
         Delete = null;
     }
     if (Done != null)
     {
         Done.Dispose();
         Done = null;
     }
     if (Name != null)
     {
         Name.Dispose();
         Name = null;
     }
     if (Notes != null)
     {
         Notes.Dispose();
         Notes = null;
     }
     if (Save != null)
     {
         Save.Dispose();
         Save = null;
     }
 }
Esempio n. 8
0
        private async void OnSave()
        {
            var editingExchangeRate = Mapper.Map <EditableExchangeRate, ExchangeRate>(ExchangeRate);

            try
            {
                if (EditMode)
                {
                    await _exchangeRatesService.UpdateExchangeRateAsync(editingExchangeRate);
                }
                else
                {
                    await _exchangeRatesService.AddExchangeRateAsync(editingExchangeRate);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                ExchangeRate = null;
            }
        }
Esempio n. 9
0
 public IObservable <ITransition> Start()
 => dataSource.User.Get()
 .Select(user => user.DefaultWorkspaceId.HasValue)
 .Do(trackNoDefaultWorkspaceIfNeeded)
 .Select(userHasDefaultWorkspace => userHasDefaultWorkspace
             ? Done.Transition()
             : NoDefaultWorkspaceDetected.Transition());
Esempio n. 10
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var formatter = new BinaryFormatter();

            switch (ActionId)
            {
            case ActionName.Doing:
                var DoingClass = new Doing(Time.SelectedDate.Value, ActionNameText.Text);

                using (var fs = new FileStream(FileName, FileMode.OpenOrCreate))
                {
                    formatter.Serialize(fs, DoingClass);
                }
                break;

            case ActionName.NeedToDo:
                var NeedToDoClass = new NeedToDo(Time.SelectedDate.Value, ActionNameText.Text);

                using (var fs = new FileStream(FileName, FileMode.OpenOrCreate))
                {
                    formatter.Serialize(fs, NeedToDoClass);
                }
                break;

            case ActionName.Done:
                var DoneClass = new Done(Time.SelectedDate.Value, ActionNameText.Text);

                using (var fs = new FileStream(FileName, FileMode.OpenOrCreate))
                {
                    formatter.Serialize(fs, DoneClass);
                }
                break;
            }
        }
        private async void OnSave()
        {
            var editingDL = Mapper.Map <EditableDL, DL>(DL);

            try
            {
                if (EditMode)
                {
                    await _dLsService.UpdateDLAsync(editingDL);
                }
                else
                {
                    await _dLsService.AddDLAsync(editingDL);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                DL = null;
            }
        }
    /*[MenuItem("AAA/BBB")]
     * private static void Goga()
     * {
     *  FindObjectOfType<PutCopy>().Go();
     * }
     *
     * [MenuItem("AAA/CCC")]
     * private static void Gogaaaa()
     * {
     *  StaticBatchingUtility.Combine(GameObject.Find("terrain"));
     * }*/

    public void Go()
    {
        PrepareTextureSwitchesCaches();
        var copies = new GameObject("copies");

        copies.transform.parent = GameObject.Find("terrain").transform;
        foreach (var copy in Copies)
        {
            /*if (copy.ToCopy.activeSelf)
             *  copy.ToCopy.SetActive(false);*/

            if (!copy.ToCopy)
            {
                continue;
            }

            foreach (Rigidbody rb in copy.ToCopy.GetComponentsInChildren <Rigidbody>())
            {
                Destroy(rb);
            }

            GameObject gameObj = Instantiate(copy.ToCopy, copy.Position, copy.Rotation, copies.transform);
            gameObj.name = copy.ToCopy.name;
            ApplyTextureSwitches(gameObj);
        }
        Done?.Invoke();
    }
Esempio n. 13
0
        public void Restore(string filePath, string destFolder)
        {
            Initializing?.Invoke();

            using (FileStream fs = File.OpenRead(filePath))
            {
                var    reader = new RawDataReader(fs, Encoding.UTF8);
                byte[] sign   = Signature;

                foreach (byte b in sign)
                {
                    if (reader.ReadByte() != b)
                    {
                        throw new CorruptedFileException(filePath);
                    }
                }

                reader.ReadTime();           //ignore creation time
                int headerLen = reader.ReadInt();
                reader.ReadBytes(headerLen); //ignore header

                Restoring?.Invoke();
                var bag = new FilesBag();

                Clean(destFolder);

                bag.Decompress(fs, destFolder);

                Done?.Invoke();
            }
        }
Esempio n. 14
0
        public void Backup(string filePath, string srcFolder, byte[] archHeader)
        {
            Initializing?.Invoke();

            FilesBag bag = CreateBag(srcFolder);

            FileStream fsDest = null;

            try
            {
                fsDest = File.Create(filePath);
                var writer = new RawDataWriter(fsDest, Encoding.UTF8);
                writer.Write(Signature);
                writer.Write(DateTime.Now);
                writer.Write(archHeader.Length);
                writer.Write(archHeader);

                Compressing?.Invoke();
                bag.Compress(fsDest);

                Done?.Invoke();
            }
            catch
            {
                if (fsDest != null)
                {
                    fsDest.Dispose();
                    File.Delete(filePath);
                }

                throw;
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Execution of new scrum that will dete tasks from Done, and put all current task to BackLog.
        /// </summary>
        public void NewScrumCommandExecute()
        {
            foreach (var i in Done)
            {
                DeleteTask(i);
            }

            Done.Clear();

            foreach (var i in Doing)
            {
                i.States = BackLog.State.Backlog;
                PutTask(i);
                Backlog.Add(i);
            }
            foreach (var i in ToDo)
            {
                i.States = BackLog.State.Backlog;
                PutTask(i);
                Backlog.Add(i);
            }

            Doing.Clear();
            ToDo.Clear();
        }
        private async void OnSave()
        {
            var editingCurrency = Mapper.Map <EditableCurrency, Currency>(Currency);

            try
            {
                if (EditMode)
                {
                    await _currenciesService.UpdateCurrencyAsync(editingCurrency);
                }
                else
                {
                    await _currenciesService.AddCurrencyAsync(editingCurrency);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed.Invoke(ex);
            }
            finally
            {
                Currency = null;
            }
        }
Esempio n. 17
0
        private async void OnSave()
        {
            var editingGL = Mapper.Map <EditableGL, GL>(GL);

            try
            {
                if (EditMode)
                {
                    await _gLsService.UpdateGLAsync(editingGL);
                }
                else
                {
                    await _gLsService.AddGLAsync(editingGL);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                GL = null;
            }
        }
Esempio n. 18
0
        private async void OnSave()
        {
            var editingDocumentNumbering = Mapper.Map <EditableDocumentNumbering, DocumentNumbering>(DocumentNumbering);

            try
            {
                if (EditMode)
                {
                    await _documentNumberingsService.UpdateDocumentNumberingAsync(editingDocumentNumbering);
                }
                else
                {
                    await _documentNumberingsService.AddDocumentNumberingAsync(editingDocumentNumbering);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                DocumentNumbering = null;
            }
        }
Esempio n. 19
0
        private void webView_Navigating(object sender, NavigatingCancelEventArgs e)
        {
            if (e.Uri.ToString().StartsWith(_callbackUri.AbsoluteUri))
            {
                if (e.Uri.AbsoluteUri.Contains("#"))
                {
                    AuthorizeResponse = new AuthorizeResponse(e.Uri.AbsoluteUri);
                }
                else
                {
                    var document      = (IHTMLDocument3)((WebBrowser)sender).Document;
                    var inputElements = document.getElementsByTagName("INPUT").OfType <IHTMLElement>();
                    var resultUrl     = "?";

                    foreach (var input in inputElements)
                    {
                        resultUrl += input.getAttribute("name") + "=";
                        resultUrl += input.getAttribute("value") + "&";
                    }

                    resultUrl         = resultUrl.TrimEnd('&');
                    AuthorizeResponse = new AuthorizeResponse(resultUrl);
                }

                e.Cancel        = true;
                this.Visibility = Visibility.Hidden;

                if (Done != null)
                {
                    Done.Invoke(this, AuthorizeResponse);
                }
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Standard procedure to send command to the mutex thread.
        /// </summary>
        /// <param name="command"></param>
        /// <param name="cancellationToken"></param>
        /// <param name="pollInterval"></param>
        /// <returns></returns>
        private async Task SetCommandAsync(int command, CancellationToken cancellationToken, int pollInterval)
        {
            if (!IsAlive)
            {
                throw new InvalidOperationException("Thread should be alive.");
            }

            Interlocked.Exchange(ref _command, command);             // Set the command.
            lock (LatestHoldLockExceptionLock)
            {
                LatestHoldLockException = null;
            }
            Done.Reset();           // Reset the Done.
            ToDo.Set();             // Indicate that there is a new command.
            while (!Done.WaitOne(1))
            {
                // Waiting for Done asynchronously.
                await Task.Delay(pollInterval, cancellationToken);
            }
            lock (LatestHoldLockExceptionLock)
            {
                // If we had an exception then throw it.
                if (LatestHoldLockException != null)
                {
                    throw LatestHoldLockException;
                }
            }
        }
        private async void OnSave()
        {
            var editingCustomer = Mapper.Map <EditableUser, User>(User);

            try
            {
                if (EditMode)
                {
                    await _usersService.UpdateUserAsync(editingCustomer);
                }
                else
                {
                    await _usersService.AddUserAsync(editingCustomer);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                User = null;
            }
        }
Esempio n. 22
0
        public async Task Start(string[] arguments)
        {
            Settings = Config.Current.GetSettings <EngineSettings>();
            Settings.WithRandomSuffixAppendedToStreamName();

            Logger = LogProvider.GetCurrentClassLogger();

            Engine = await new EngineBuilder().Build <KeyValueStore <int> >();

            var totals = new List <TimeSpan>(Runs);

            for (var run = 0; run < Runs; run++)
            {
                Logger.Info($"Run {run + 1}");

                var stopwatch = Stopwatch.StartNew();

                await Run();

                stopwatch.Stop();

                totals.Add(stopwatch.Elapsed);

                await Total(stopwatch.Elapsed);
            }

            await Engine.DisposeAsync();

            await Totals(totals);

            Done?.Invoke(this, EventArgs.Empty);
        }
Esempio n. 23
0
        private async Task LoadTasks()
        {
            var result = await apiService.GetAllTasks();

            if (result.HttpResponse.IsSuccessStatusCode)
            {
                foreach (var item in result.Data)
                {
                    switch (item.Status)
                    {
                    case 0:
                        ToDo.Add(ViewModelHelper.Get(item));
                        break;

                    case 1:
                        Doing.Add(ViewModelHelper.Get(item));
                        break;

                    case 2:
                        Done.Add(ViewModelHelper.Get(item));
                        break;
                    }
                }
            }
        }
        private async void OnSave()
        {
            var editingAccountDocument = Mapper.Map <EditableAccountDocument, AccountDocument>(AccountDocument);

            try
            {
                if (EditMode)
                {
                    await _accountDocumentsService.UpdateAccountDocumentAsync(editingAccountDocument);
                }
                else
                {
                    await _accountDocumentsService.AddAccountDocumentAsync(editingAccountDocument);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                AccountDocument = null;
            }
        }
Esempio n. 25
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Reward != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Reward);
            }
            if (Done != false)
            {
                hash ^= Done.GetHashCode();
            }
            if (MaxStepReached != false)
            {
                hash ^= MaxStepReached.GetHashCode();
            }
            if (Id != 0)
            {
                hash ^= Id.GetHashCode();
            }
            hash ^= actionMask_.GetHashCode();
            hash ^= observations_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 26
0
        public MainPageViewModel()
        {
            MessagingCenter.Subscribe <string>(this, "ExecuteAction", (actionToExecute) =>
            {
                switch (actionToExecute)
                {
                case "Clean":
                    ToDo.Clear();
                    Doing.Clear();
                    Done.Clear();
                    break;

                case "Reset":
                    break;

                case "OtherPage":
                case "AboutPage":
                    navigationService.Navigate(actionToExecute);
                    break;
                }
            });

            navigationService = new NavigationService();
            apiService        = new ApiService();

            ToDo  = new ObservableCollection <TaskItemViewModel>();
            Doing = new ObservableCollection <TaskItemViewModel>();
            Done  = new ObservableCollection <TaskItemViewModel>();

            LoadTasks();
        }
Esempio n. 27
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (metadata_ != null)
            {
                hash ^= Metadata.GetHashCode();
            }
            if (Done != false)
            {
                hash ^= Done.GetHashCode();
            }
            if (resultCase_ == ResultOneofCase.Error)
            {
                hash ^= Error.GetHashCode();
            }
            if (resultCase_ == ResultOneofCase.Response)
            {
                hash ^= Response.GetHashCode();
            }
            return(hash);
        }
Esempio n. 28
0
 private void button6_Click(object sender, EventArgs e)
 {
     Done.PerformClick();
     Updated();
     button7.Hide();
     dataGridView5.Hide();
 }
 private void onAnimationDone(EventArgs i_EventArgs)
 {
     if (Done != null)
     {
         Done.Invoke(this, i_EventArgs);
     }
 }
        private async void OnSave()
        {
            var editingGroup = Mapper.Map <EditableGroup, Group>(Group);

            try
            {
                if (EditMode)
                {
                    await _groupsService.UpdateGroupAsync(editingGroup);
                }
                else
                {
                    await _groupsService.AddGroupAsync(editingGroup);
                }
                Done?.Invoke();
            }
            catch (Exception ex)
            {
                Failed(ex);
            }
            finally
            {
                Group = null;
            }
        }
Esempio n. 31
0
			// id is user data.
			public Lane(ulong id, int slots)
			{
				Out = new PendingOut[slots];
				Progress = new InProgress[slots];
				Done = new Done[slots];
				Acks = new uint[slots];
				Id = id;
				LagMsMin = 0;
				ResendMs = 200;
			}
Esempio n. 32
0
        static void Remoting(Action<bool> done)
        {
            var d = AppDomain.CreateDomain("RemotingTest");

            var xs = Observable.Range(0, 10, Scheduler.Default).Remotable();
            var dn = new Done(done);

            d.SetData("xs", xs);
            d.SetData("dn", dn);

            d.DoCallBack(() =>
            {
                var ys = (IObservable<int>)AppDomain.CurrentDomain.GetData("xs");

                var res = ys.ToArray().Wait();

                var b = res.SequenceEqual(Enumerable.Range(0, 10));

                ((Done)AppDomain.CurrentDomain.GetData("dn")).Set(b);
            });
        }
Esempio n. 33
0
        /// <summary>
        /// Informs a region about an Agent
        /// </summary>
        /// <param name="TalkingAbout">User to talk about</param>
        /// <param name="UserToUpdate">User we're sending this too (contains the region)</param>
        public void SendRegionPresenceUpdate(UserPresenceData TalkingAbout, UserPresenceData UserToUpdate)
        {
            // TODO: Fill in pertenant Presence Data from 'TalkingAbout'
            RegionProfileData whichRegion = new RegionProfileData();
            if (lookupRegion)
            {
                handlerGetRegionData = OnGetRegionData;
                if (handlerGetRegionData != null)
                {
                    whichRegion = handlerGetRegionData(UserToUpdate.regionData.regionHandle);
                }
                //RegionProfileData rp = RegionProfileData.RequestSimProfileData(UserToUpdate.regionData.regionHandle, gridserverurl, gridserversendkey, gridserverrecvkey);

                //whichRegion = rp;
            }
            else
            {
                whichRegion = UserToUpdate.regionData;
            }
            //whichRegion.httpServerURI

            if (whichRegion != null)
            {
                Hashtable PresenceParams = new Hashtable();
                PresenceParams.Add("agent_id",TalkingAbout.agentData.AgentID.ToString());
                PresenceParams.Add("notify_id",UserToUpdate.agentData.AgentID.ToString());
                if (TalkingAbout.OnlineYN)
                    PresenceParams.Add("status","TRUE");
                else
                    PresenceParams.Add("status","FALSE");

                ArrayList SendParams = new ArrayList();
                SendParams.Add(PresenceParams);

                m_log.InfoFormat("[PRESENCE]: Informing {0}@{1} at {2} about {3}", TalkingAbout.agentData.FirstName + " " + TalkingAbout.agentData.LastName, whichRegion.regionName, whichRegion.httpServerURI, UserToUpdate.agentData.FirstName + " " + UserToUpdate.agentData.LastName);

                // Send
                string methodName = "presence_update";
                XmlRpcRequest RegionReq = new XmlRpcRequest(methodName, SendParams);
                try
                {
                    // XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000);
                    RegionReq.Send(Util.XmlRpcRequestURI(whichRegion.httpServerURI, methodName), 6000);
                }
                catch (WebException)
                {
                    m_log.WarnFormat("[INFORM]: failed notifying region {0} containing user {1} about {2}", whichRegion.regionName, UserToUpdate.agentData.FirstName + " " + UserToUpdate.agentData.LastName, TalkingAbout.agentData.FirstName + " " + TalkingAbout.agentData.LastName);
                }
            }
            else
            {
                m_log.Info("[PRESENCEUPDATER]: Region data was null skipping");

            }

            handlerDone = OnDone;
            if (handlerDone != null)
            {
                handlerDone(this);
            }
        }
Esempio n. 34
0
		// Return if there is more to come.
		public static bool ProcessLanesIncoming(LaneSetup setup, Lane[] lanes, Done[] output, out uint numOut)
		{
			numOut = 0;

			// Check the progress if we can pick another one.
			for (int i=0;i<lanes.Length;i++)
			{
				Lane lane = lanes[i];

				while (lane.DoneTail != lane.DoneHead)
				{
					uint t = lane.DoneTail % (uint)lane.Done.Length;
					output[numOut] = lane.Done[t];
					lane.DoneTail = lane.DoneTail + 1;
					if (++numOut == output.Length)
					{
						return true;
					}
				}

				if (lane.ProgressHead == lane.ProgressTail)
				{
					continue;
				}

				uint numProgress = (uint)lane.Progress.Length;

				// Clear out any seqId=0 (these are empty slots).
				while (lane.ProgressHead != lane.ProgressTail && lane.Progress[lane.ProgressTail % numProgress].SeqId == 0)
				{
					lane.ProgressTail++;
				}

				// And from the head too...
				while (lane.ProgressHead != lane.ProgressTail && lane.Progress[(numProgress + lane.ProgressHead-1) % numProgress].SeqId == 0)
				{
					lane.ProgressHead--;
				}

				if (lane.ProgressHead == lane.ProgressTail)
				{
					continue;
				}

				// Sort them by seq. There shouldn't be so many here. Maybe do something more clever if the count grows big.
				uint count = lane.ProgressHead - lane.ProgressTail;
				while (count > 1)
				{
					bool swapped = false;
					for (uint j = 0;j < (count-1); j++)
					{
						uint idx0 = (lane.ProgressTail + j) % numProgress;
						uint idx1 = (lane.ProgressTail + j + 1) % numProgress;
						if (lane.Progress[idx0].SeqId > lane.Progress[idx1].SeqId)
						{
							InProgress tmp = lane.Progress[idx0];
							lane.Progress[idx0] = lane.Progress[idx1];
							lane.Progress[idx1] = tmp;
							swapped = true;
						}
					}
					if (!swapped)
					{
						break;
					}
				}

				// Guaranteed to have them sorted in order now.
				uint head = lane.ProgressTail;
				uint next = lanes[i].ReliableSeq + 1;

				uint[] aggregateIdx = new uint[128];
				uint aggregateCount = 0;

				uint tail = lane.ProgressTail;
				while (tail != lane.ProgressHead)
				{
					uint idx = tail % numProgress;
					if (lane.Progress[idx].SeqId != next)
					{
						break;
					}
					if (lane.Progress[idx].IsFinalPiece)
					{
						if (aggregateCount == 0)
						{
							output[numOut].ArrivalTime = lane.Progress[idx].ArrivalTime;
							output[numOut].CompletionTime = lane.Progress[idx].ArrivalTime;
							output[numOut].Reliable = true;
							output[numOut].SeqId = lane.Progress[idx].SeqId;
							output[numOut].Data = lane.Progress[idx].Data;
							output[numOut].Lane = lane;
							lane.Progress[idx].SeqId = 0;
							lane.ReliableSeq = next;
							tail = tail + 1;
							next = next + 1;
							if (++numOut == output.Length)
							{
								return true;
							}
						}
						else
						{
							// There is always one room because check belowe makes sure of that.
							aggregateIdx[aggregateCount++] = idx;
							uint bits = 0;
							for (int k=0;k<aggregateCount;k++)
							{
								uint ki = aggregateIdx[k];
								bits = bits + lane.Progress[ki].Data.BitsLeft();
							}
							Bitstream.Buffer total = setup.Factory.GetBuffer(bits / 8 + 16);
							for (int k=0;k<aggregateCount;k++)
							{
								uint ki = aggregateIdx[k];
								Bitstream.Insert(total, lane.Progress[ki].Data);
								lane.Progress[ki].SeqId = 0;
							}
							total.Flip();
							output[numOut].ArrivalTime = lane.Progress[aggregateIdx[0]].ArrivalTime;
							output[numOut].CompletionTime = lane.Progress[idx].ArrivalTime;
							output[numOut].Reliable = true;
							output[numOut].SeqId = lane.Progress[idx].SeqId;
							output[numOut].Data = total;
							output[numOut].Lane = lane;
							lane.ReliableSeq = next;
							tail = tail + 1;
							next = next + 1;
							aggregateCount = 0;
							if (++numOut == output.Length)
							{
								return true;
							}
						}
					}
					else
					{
						aggregateIdx[aggregateCount] = idx;
						next = next + 1;
						tail = tail + 1;
						if (++aggregateCount >= (aggregateIdx.Length-1))
						{
							// THis should never happen.
							Console.WriteLine("ERROR: Progress buffer reset because aggregateIdx overflowed.");
							lane.ProgressHead = 0;
							lane.ProgressTail = 0;
							break;
						}
					}
				}
			}
			return false;
		}