Ejemplo n.º 1
0
 /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
 /// <summary>
 /// Detects if we are a single line command
 /// </summary>
 public bool IsSingleLine()
 {
     if (CommandList.Count() > 1)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        public async Task ExecuteRefresh()
        {
            try
            {
                CommandViewModel cmd = SelectedContent;

                var cmds = await _warehouse.DBService.GetCommands(Command.EnumCommandStatus.Finished, DateFrom.TimeStamp, DateTo.TimeStamp);

                CommandList.Clear();
                foreach (var c in cmds)
                {
                    if (c is CommandMaterial)
                    {
                        CommandList.Add((CommandViewModel) new CommandMaterialViewModel {
                            Command = c
                        });
                    }
                    else if (c is CommandSegment)
                    {
                        CommandList.Add((CommandViewModel) new CommandSegmentViewModel {
                            Command = c
                        });
                    }
                    else
                    {
                        CommandList.Add((CommandViewModel) new CommandCommandViewModel {
                            Command = c
                        });
                    }
                }
                foreach (var c in CommandList)
                {
                    c.Initialize(_warehouse);
                }
                Records = CommandList.Count();
                if (cmd != null)
                {
                    SelectedContent = CommandList.FirstOrDefault(p => p.ID == cmd.ID);
                }
            }
            catch (Exception e)
            {
                _warehouse.AddEvent(Database.Event.EnumSeverity.Error, Database.Event.EnumType.Exception,
                                    string.Format("{0}.{1}: {2}", this.GetType().Name, (new StackTrace()).GetFrame(0).GetMethod().Name, e.Message));
            }
        }