public static RevisionObject RevisionRowToObject(DataRow Revision) { RevisionObject obj = new RevisionObject(); try { if (Revision != null) { if (RowFunctions.GetValueFromRowToGuid(Revision, RevisionObject.REV_ID, false, DataRowVersion.Current) != Guid.Empty) { obj.RevID = RowFunctions.GetValueFromRowToGuid(Revision, RevisionObject.REV_ID, true, DataRowVersion.Current); obj.MaterialCategory = MaterialCategoryConvertor.MaterialCategoryRowToObject(Revision, ""); obj.MaterialType = MaterialTypeConvertor.MaterialTypeRowToObject(Revision, ""); obj.MaterialSubType = MaterialSubTypeConvertor.MaterialSubTypeRowToObject(Revision, ""); obj.Revision = RowFunctions.GetValueFromRowToString(Revision, RevisionObject.REVISION, false, DataRowVersion.Current); } return(obj); } obj = null; } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } return(obj); }
public void Remove(RevisionObject value) { try { List.Remove(value); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
public int Add(RevisionObject value) { try { return(List.Add(value)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// Called by RevisionObject when it changes internal void RevisionObjectChanged(RevisionObject Revision) { try { int index = List.IndexOf(Revision); OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
// Methods. object IBindingList.AddNew() { try { RevisionObject Revision = new RevisionObject(); List.Add(Revision); return(Revision); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
protected override void OnRemoveComplete(int index, object value) { try { RevisionObject Revision = (RevisionObject)value; Revision.Parent = this; OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index)); } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
protected override void OnSetComplete(int index, object oldValue, object newValue) { try { if (oldValue != newValue) { RevisionObject oldRevision = (RevisionObject)oldValue; RevisionObject newRevision = (RevisionObject)newValue; oldRevision.Parent = null; newRevision.Parent = this; OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index)); } } catch (System.Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } }