private void OnCreate() { Guid pumpStationUID = IElementPumpStation.PumpStationUID; var createPumpStationEventArg = new CreateGKPumpStationEventArgs(); ServiceFactory.Events.GetEvent<CreateGKPumpStationEvent>().Publish(createPumpStationEventArg); if (createPumpStationEventArg.PumpStation != null) GKPlanExtension.Instance.RewriteItem(IElementPumpStation, createPumpStationEventArg.PumpStation); if (!createPumpStationEventArg.Cancel) Close(true); }
void OnCreateNew() { var createGKPumpStationventArg = new CreateGKPumpStationEventArgs(); ServiceFactory.Events.GetEvent<CreateGKPumpStationEvent>().Publish(createGKPumpStationventArg); if (createGKPumpStationventArg.PumpStation != null) { SourcePumpStations.Add(createGKPumpStationventArg.PumpStation); SelectedSourcePumpStation = SourcePumpStations.FirstOrDefault(x => x == createGKPumpStationventArg.PumpStation); } }