public static async Task SetStep(ProcessStep step, HashRedisKey hash)
        {
            var props = new[]
            {
                new HashEntry("processStep", step.ToString())
            };

            await hash.SetAsync(props);
        }
Beispiel #2
0
        private static List <FolderDto> FailedFiles(string folderPath, IDictionary <string, List <string> > files, ProcessStep step)
        {
            var reconstructionInputFiles = Directory.GetFiles(folderPath, "*.*", SearchOption.TopDirectoryOnly);

            foreach (var reconstructionInputFile in reconstructionInputFiles)
            {
                int    lastPosition = reconstructionInputFile.LastIndexOf('\\');
                string file         = reconstructionInputFile.Substring(lastPosition + 1);

                int    firstPosition = file.IndexOf('.');
                string key           = file.Substring(0, firstPosition - 1);

                if (!files.ContainsKey(key))
                {
                    files.Add(key, new List <string>()
                    {
                        file
                    });
                }
                else
                {
                    files[key].Add(file);
                }
            }

            List <FolderDto> returnValue = new List <FolderDto>();

            foreach (var file in files)
            {
                if (file.Value.Count > 2)
                {
                    if (file.Value.Any(x => x.EndsWith(".zip.fail")))
                    {
                        returnValue.Add(new FolderDto()
                        {
                            DateCreated = DateTime.Now,
                            Name        = file.Key,
                            IsFailed    = true,
                            Type        = step.ToString()
                        });
                    }
                }
            }

            return(returnValue);
        }
		private void SetLabelStage (Label ll, Label ll1, Label ll2, ProcessStep step)
		{
			string text = "^";
			Color c = Color.Accent;
			string progressTextBase = step.ToString ();
			switch (step) {
			case ProcessStep.Waiting:
				text = "^";
				c = Global.ColorBoxLowText;
				break;
			case ProcessStep.Loading:
				text = "&";
				c = Global.ColorBoxText;
				break;
			case ProcessStep.Processing:
				text = "#";
				c = Global.ColorBoxText;
				break;
			case ProcessStep.Ready:
				text = "$";
				c = Global.ColorBoxHighText;
				break;
			case ProcessStep.Broken:
				text = "*";
				c = Global.ColorBoxLowText;
				break;
			}
			if (!isFinish) {
				stepNumber.Add (this.step);
				status.Add (progressTextBase);
			}
			Device.BeginInvokeOnMainThread (() => {
				ShowStatus (true);
				ll.Text = text;
				ll.TextColor = c;
				ll1.TextColor = c;
				ll2.TextColor = c;
			});
		}
Beispiel #4
0
 /// <summary>
 /// Create an EventId used for logging
 /// </summary>
 private static EventId EventId(ProcessStep step) =>
 new EventId(ServiceLevelEventId + MethodLevelEventId + (int)step, step.ToString());