internal void CallEvent(EventModelBase model) { foreach (var item in _targets[model.GetType()]) { item.DynamicInvoke(model); } }
private void ReplayEvent(EventModelBase modelBase, float currentTimeSinceStartSeconds) { var eventType = modelBase.EventType; var instruction = _replayInstructions.Find(instr => instr.Name == eventType); if (instruction != null) { if (!instruction.EnableReplay) { if (modelBase is ComponentEventModel comp) { _debugger.Log($"Replay disabled time:{currentTimeSinceStartSeconds:0.00}, type:{comp.EventType}, gameObject:{comp.GameObjectName}, comp:{comp.ComponentType}"); } else { _debugger.Log($"Replay disabled time:{currentTimeSinceStartSeconds:0.00}, type:{modelBase.EventType}"); } return; } if (modelBase is ComponentEventModel compo) { _debugger.Log($"Replaying Event: time:{currentTimeSinceStartSeconds:0.00}, type:{compo.EventType}, gameObject:{compo.GameObjectName}, comp:{compo.ComponentType}"); } else { _debugger.Log($"Replaying Event: time:{currentTimeSinceStartSeconds:0.00}, type:{modelBase.EventType}"); } instruction.Replay(modelBase); return; } _debugger.LogWarning($"No event type found named:{eventType}"); }
public IList <EventModelBase> GetItemsFromCsvFile() { string path = PathFinder.GetPathToCsvDb(); if (path == null) { throw new InvalidOperationException("path"); } if (!File.Exists(path)) { throw new InvalidOperationException("path doesn't exist"); } StreamReader reader = new StreamReader(path); List <EventModelBase> events = new List <EventModelBase>(); while (reader.Peek() >= 0) { string content = reader.ReadLine(); EventModelBase newEvent = _parser.ParseRow(content); if (newEvent != null) { events.Add(newEvent); } } return(events); }
public bool UpdateEvent(EventModelBase eventForUpdate) { if (eventForUpdate == null) { throw new ArgumentNullException("eventForUpdate"); } return(_writer.WriteEventsToExcel(Events)); }
public virtual bool UpdateEvent(EventModelBase myEvent) { if (myEvent == null) { throw new ArgumentNullException("myEvent"); } _connection.UpdateEvent(myEvent); return(true); }
public bool AddEvent(EventModelBase eventForAdding) { if (eventForAdding == null) { throw new ArgumentNullException("eventForAdding"); } Events.Add(eventForAdding); return(_writer.WriteEventsToExcel(Events)); }
public virtual bool AddEvent(EventModelBase myEvent) { if (myEvent == null) { throw new ArgumentNullException("myEvent"); } bool result = _connection.AddEvent(myEvent); OnChangingEvents(); return(result); }
public bool RemoveEvent(EventModelBase eventForRemoving) { if (eventForRemoving == null) { throw new ArgumentNullException("eventForRemoving"); } if (Events.Contains(eventForRemoving)) { Events.Remove(eventForRemoving); return(_writer.WriteEventsToExcel(Events)); } return(false); }
public bool RemoveEvent(EventModelBase eventForRemoving) { if (eventForRemoving == null) { throw new ArgumentNullException("eventForRemoving"); } if (_events == null) { throw new InvalidOperationException("_events is null"); } if (_events.Contains(eventForRemoving)) { _events.Remove(eventForRemoving); } _writer.WriteAllEventsToBd(Events); return(true); }
private void selectionChangedExecute(SelectionChangedEventArgs e) { if (e == null) { throw new ArgumentNullException("e"); } if (e.AddedItems.Count != 0) { EventModelBase myEvent = e.AddedItems[0] as EventModelBase; _bridge.CurrentEvent = myEvent; } else { _bridge.CurrentEvent = new SimpleEventModel("No Event is selected", "", DateTime.Now); // если вызвать команду "”далить" или "—охранить", // то на данном событие оно не сработает, пометили как бы виртуальное. _bridge.CurrentEvent.ID = -1; } }
private void OnChangingEvent(EventModelBase myEvent) { if (myEvent == null) { throw new ArgumentNullException("myEvent"); } Name = myEvent.Name; Description = myEvent.Description; DatePlanned = myEvent.DatePlanned; DateCreated = myEvent.DateCreated; if (myEvent.Name == "No Event is selected") { flafVirtualEvent = false; } else { flafVirtualEvent = true; } RaisePropertyChanged("EventSelected"); RaisePropertyChanged("EventIsNotSelected"); }
public void Replay(EventModelBase model) { _onReplay.Invoke(model); }
public bool UpdateEvent(EventModelBase eventForUpdate) { _writer.WriteAllEventsToBd(Events); return(true); }