static T ProcessAction <T>(T obj, AtmlActionType actionType, EventArgs args) { if (obj is IAtmlObject && actionType == AtmlActionType.Delete) { ((IAtmlObject)obj).IsDeleted(true); } T results = default(T); if (obj.GetType() == typeof(TestStationDescription11)) { results = (T)Convert.ChangeType(ProcessAction(obj as TestStationDescription11, actionType, args), typeof(T)); } else if (obj.GetType() == typeof(TestConfiguration15)) { results = (T)Convert.ChangeType(ProcessAction(obj as TestConfiguration15, actionType, args), typeof(T)); } else if (obj.GetType() == typeof(UUTDescription)) { results = (T)Convert.ChangeType(ProcessAction(obj as UUTDescription, actionType, args), typeof(T)); } else if (obj.GetType() == typeof(TestAdapterDescription1)) { results = (T)Convert.ChangeType(ProcessAction(obj as TestAdapterDescription1, actionType, args), typeof(T)); } else if (obj.GetType() == typeof(InstrumentDescription)) { results = (T)Convert.ChangeType(ProcessAction(obj as InstrumentDescription, actionType, args), typeof(T)); } return(results); }
private static TestConfiguration15 ProcessAction(TestConfiguration15 obj, AtmlActionType actionType, EventArgs args) { IAtmlController <TestConfiguration15> controller = TestConfigurationController.Instance; return(Process(obj, actionType, controller, args)); }
private static T Process <T>(T obj, AtmlActionType actionType, IAtmlController <T> controller, EventArgs args) { T retVal = default(T); switch (actionType) { case AtmlActionType.Add: controller.Save(obj); break; case AtmlActionType.Edit: controller.Save(obj); break; case AtmlActionType.Delete: controller.Save(obj); break; case AtmlActionType.Find: AtmlActionEventArgs aeArgs = args as AtmlActionEventArgs; if (aeArgs != null) { retVal = controller.Find(aeArgs.Guid); } break; } return(retVal); }
private void CallAtmlAction(object o, AtmlActionType type) { var id = o as TestAdapterDescription1; if (id != null) { OnAtmlObjectAction(id, type); } }
protected virtual void OnAtmlAction(IAtmlObject obj, AtmlActionType actiontype) { AtmlActionDeligate <IAtmlObject> handler = AtmlObjectAction; if (handler != null) { handler(obj, actiontype, EventArgs.Empty); } }
private void CallAtmlAction(object o, AtmlActionType type) { var id = o as InstrumentDescription; if (id != null) { OnAtmlObjectAction(id, type); } }
protected virtual IAtmlObject OnAtmlObjectAction(IAtmlObject obj, AtmlActionType actiontype, EventArgs args) { AtmlActionDeligate <IAtmlObject> handler = AtmlObjectAction; if (handler != null) { obj = handler(obj, actiontype, args); } return(obj); }
protected virtual IAtmlObject OnAtmlObjectAction(IAtmlObject obj, AtmlActionType actiontype) { IAtmlObject results = null; AtmlActionDeligate <IAtmlObject> handler = AtmlObjectAction; if (handler != null) { results = handler(obj, actiontype, EventArgs.Empty); } return(results); }
private void CallAtmlAction( object o, AtmlActionType type ) { var id = o as InstrumentDescription; if (id != null) { OnAtmlObjectAction( id, type ); } }
protected virtual IAtmlObject OnAtmlObjectAction( IAtmlObject obj, AtmlActionType actiontype ) { IAtmlObject results = null; AtmlActionDeligate<IAtmlObject> handler = AtmlObjectAction; if (handler != null) results = handler( obj, actiontype, EventArgs.Empty ); return results; }
protected virtual IAtmlObject OnAtmlObjectAction( IAtmlObject obj, AtmlActionType actiontype ) { AtmlActionDeligate<IAtmlObject> handler = AtmlObjectAction; if (handler != null) obj = handler( obj, actiontype, EventArgs.Empty ); return obj; }
private IAtmlObject _configurationForm_AtmlObjectAction(IAtmlObject obj, AtmlActionType actionType, EventArgs args) { OnAtmlObjectAction(obj, actionType, args); return(obj); }
private void CallAtmlAction( object o, AtmlActionType type ) { var id = o as TestAdapterDescription1; if (id != null) { OnAtmlObjectAction( id, type ); } }
private IAtmlObject _configurationForm_AtmlObjectAction( IAtmlObject obj, AtmlActionType actionType, EventArgs args) { OnAtmlObjectAction( obj, actionType, args ); return obj; }
private IAtmlObject testConfigurationControl1_ProjectUutChanged(IAtmlObject uutDescription, AtmlActionType actionType, EventArgs args) { OnAtmlObjectAction(uutDescription, actionType, args); return uutDescription; }
private static InstrumentDescription ProcessAction(InstrumentDescription obj, AtmlActionType actionType, EventArgs args) { IAtmlController <InstrumentDescription> controller = InstrumentController.Instance; obj.DataState = actionType.Equals(AtmlActionType.Add) ? BASEBean.eDataState.DS_ADD : actionType.Equals(AtmlActionType.Edit) ? BASEBean.eDataState.DS_EDIT : actionType.Equals(AtmlActionType.Delete) ? BASEBean.eDataState.DS_DELETE : BASEBean.eDataState.DS_NO_CHANGE; return(Process(obj, actionType, controller, args)); }
private IAtmlObject testConfigurationControl1_ProjectUutChanged(IAtmlObject uutDescription, AtmlActionType actionType, EventArgs args) { OnAtmlObjectAction(uutDescription, actionType, args); return(uutDescription); }
private static TestStationDescription11 ProcessAction(TestStationDescription11 obj, AtmlActionType actionType, EventArgs args) { IAtmlController <TestStationDescription11> controller = TestStationController.Instance; return(Process(obj, actionType, controller, args)); }
private static UUTDescription ProcessAction(UUTDescription obj, AtmlActionType actionType, EventArgs args) { IAtmlController <UUTDescription> controller = UUTController.Instance; return(Process(obj, actionType, controller, args)); }