public event CreateHandler CreateEvent; //聲明事件 /// <summary> /// 生產產品 /// </summary> public void CreateProduct(string pdName) { var pd = new Product(pdName); //通知相關單位產品生產完成 CreateEvent?.Invoke(pdName); Console.WriteLine(); }
/// <inheritdoc /> /// <summary> /// Create DataEntity in Database on slot /// </summary> /// <param name="entity"></param> /// <param name="toSlotLeftTop"></param> public void CreateEntityInSlot(DataEntity entity, DataSlot toSlotLeftTop) { if (!SlotIsFree(toSlotLeftTop) && GetEntityOrNull(toSlotLeftTop) != entity) { throw new Exception("Slot must be empty!"); } RegisterEntity(entity); BindEntityToSlots(toSlotLeftTop.DataInventory, entity, toSlotLeftTop); CreateEvent.Invoke(entity); }
public VenturiControl(string name) { Venturis = GetData(); CurrentVenturi = Venturis.SingleOrDefault(v => v.Name == name); if (CurrentVenturi == null) { //log.Info("Создание Аппарата"); CurrentVenturi = new Venturi(name); CreateEvent?.Invoke(this, new NewVentEventArgs($"Аппарат создан {CurrentVenturi.Name}")); SendEmailAsync().GetAwaiter(); Venturis.Add(CurrentVenturi); IsNewVent = true; } else { Console.WriteLine("Данный аппарат существует. Нажмите 2, чтобы посмотреть все существующие аппараты."); } }
public void CreateUnit() { TileManager._Instance.CreateUnit(_deckData._unit.UnitIdx, _spawnTeam); _deckData.isUsed = true; CreateEvent?.Invoke(); }