void DeleteExecute(object param) { try { RemoveWeakEventListener(selectedVolumeEvtType, VolumeEvtListener); VolumeEvtTypeTarget.Remove(selectedVolumeEvtType); RestoreExecute(param); } catch (Exception x) { ThisView.ShowMsg(x.ToString()); } }
void RestoreExecute(object param) { try { int ind = listIndex; RemoveWeakEventListener(selectedVolumeEvtType, VolumeEvtListener); VolumeEvtTypes = VolumeEvtTypeTarget.FetchVolumeEvtType(); SelectedVolumeEvtType = VolumeEvtTypes[ (ind < VolumeEvtTypes.Count) ? ind : 0 ]; ListIndex = (ind < VolumeEvtTypes.Count) ? ind : 0; } catch (Exception x) { ThisView.ShowMsg(x.ToString()); } }
void SaveExecute(object param) { try { if (selectedVolumeEvtType.VOLUME_EVT_TYPE_ID == 0) { VolumeEvtTypeTarget.Add(selectedVolumeEvtType); } else { VolumeEvtTypeTarget.Update(selectedVolumeEvtType); } RestoreExecute(param); } catch (Exception x) { ThisView.ShowMsg(x.ToString()); } }