예제 #1
0
        public IEnumerable <Ticket> Load(bool includeDone)
        {
            List <TicketSerializableData> serializableDataList = JsonConvert.DeserializeObject <List <TicketSerializableData> >(File.ReadAllText(this.filePath));

            foreach (TicketSerializableData data in serializableDataList.OrderBy(serializableTicketData => serializableTicketData.ID))
            {
                TicketState ticketState = TicketStateRegistry.Instance.GetByCode(data.StatusCode);
                if (ticketState != null && (ticketState != TicketStateRegistry.Instance.Get <DoneTicketState>() || includeDone))
                {
                    TracTicket tracTicket = new TracTicket(data.ID);
                    Ticket     ticket     = new Ticket(tracTicket, ticketState, data.TicketProperties);
                    yield return(ticket);
                }
            }
        }
예제 #2
0
        public Ticket CreateNew(int id, TicketState initialState)
        {
            TracTicket tracTicket = new TracTicket(id);

            return(new Ticket(tracTicket, initialState, new CustomTicketProperties()));
        }
예제 #3
0
 public Ticket(TracTicket tracTicket, TicketState currentState, CustomTicketProperties ticketProperties)
 {
     this.TracTicket       = tracTicket;
     this.CurrentState     = currentState;
     this.ticketProperties = ticketProperties;
 }