/// <summary> /// Gets marked records. /// </summary> /// <returns>Returns the marked recordss.</returns> internal virtual Byte[][] GetMarkedRecords() { Debug.Assert(this.Record != null); List <Byte[]> marked = new List <Byte[]>(); using (NavRecord cachedRecord = this.Record.Clone(this.Record.IsTemporary)) using (NavRecord cachedSavedRecord = this.SavedRecord != null ? this.SavedRecord.Clone(this.SavedRecord.IsTemporary) : null) { this.Record.ALMarkedOnly = true; if (!this.Record.ALIsEmpty) { if (this.Record.ALFindFirst(DataError.TrapError)) { do { marked.Add(this.Record.ALRecordId.GetBytes()); }while (this.Record.ALNext() != 0); } } this.Record.ALCopy(cachedRecord); if (this.SavedRecord != null && cachedSavedRecord != null) { this.SavedRecord.ALCopy(cachedSavedRecord); } } return(marked.ToArray()); }
/// <summary> /// Instantiate a NsDataAccess object from a record. /// </summary> /// <param name="record">The record.</param> /// <returns>A new NsDataObject.</returns> public static NsDataAccess Create(NavRecord record) { if (record != null) { record.AddReference(); } return(new NsTableDataAccess(record)); }
/// <summary> /// Unregister from listening to record events /// </summary> internal override void StopListeningForRecordEvents() { if (!this.listening || (this.Form == null)) { return; } this.Form.SourceTableOperationsNotify -= new EventHandler <NavRecordEventArgs>(this.RecordNotify); this.savedRecord.Dispose(); this.savedRecord = null; this.listening = false; }
/// <summary> /// Register to listen to record events /// </summary> internal override void ListenForRecordEvents() { if (this.listening || (this.Form == null) || (this.Record == null)) { return; } this.savedRecord = this.Record.Clone(true); this.Form.SourceTableOperationsNotify += new EventHandler <NavRecordEventArgs>(this.RecordNotify); this.listening = true; }
/// <summary> /// Sets marked records. /// </summary> /// <param name="marked">The marked bytes.</param> internal virtual void SetMarkedRecords(Byte[][] marked) { Debug.Assert(this.Record != null); this.Record.ALClearMarks(); if (marked != null && marked.Length > 0) { using (NavRecord cachedRecord = this.Record.Clone(this.Record.IsTemporary)) { foreach (Byte[] bookmarkBytes in marked) { RecordBookmark bookmark = new RecordBookmark(bookmarkBytes); if (bookmark != null) { this.Record.SetMark(bookmark.GetBytes(), true); } } this.Record.Assign(cachedRecord); } } }
internal void GetCommittedData(object sender, EventArgs e) { NavDataSet dataSet = new NavDataSet(); NavDataTable dataTable = new NavDataTable(); dataSet.Tables.Add(dataTable); NSPage.BuildCLRDataTable(dataTable, null, this); NavDataRow row = dataTable.NewRow(); NavRecord cached = (this.Record != null) ? this.Record.Clone(this.Record.IsTemporary) : null; try { // Get the latest persisted copy of the record if (this.Record != null) { if (!this.Record.ALGet(DataError.TrapError, this.Record.ALRecordId)) { return; } } NSRecordBase.PopulateCLRTable(dataTable, this, row); dataTable.Rows.Add(row); } finally { if (cached != null) { this.Record.Assign(cached); cached.Dispose(); } } NavRecordState dataSetState = NSDatasetState.Create(this); NSClientCallback.SendCommittedDataToClient(dataSet, dataSetState); }
/// <summary> /// Register to listen to record events /// </summary> internal override void ListenForRecordEvents() { if (this.listening || (this.Form == null) || (this.Record == null)) { return; } this.savedRecord = this.Record.Clone(true); this.Form.SourceTableOperationsNotify += new EventHandler<NavRecordEventArgs>(this.RecordNotify); this.listening = true; }
/// <summary> /// Initializes a new instance of the NsTableDataAccess class. /// </summary> /// <param name="record">The record.</param> internal NsTableDataAccess(NavRecord record) { this.record = record; }
/// <summary> /// Initializes a new instance of the NsTableDataAccess class. /// </summary> /// <param name="recordId">The record ID.</param> internal NsTableDataAccess(Int32 recordId) { // Note, that there is no parent obeject avaiable for this NavRecord creation this.record = NavEnvironment.Instance.ApplicationFactory.GetTable(recordId, null); }
/// <summary> /// Instantiate a NsDataAccess object from a record. /// </summary> /// <param name="record">The record.</param> /// <returns>A new NsDataObject.</returns> public static NsDataAccess Create(NavRecord record) { if (record != null) { record.AddReference(); } return new NsTableDataAccess(record); }
/// <summary> /// Unregister from listening to record events /// </summary> internal override void StopListeningForRecordEvents() { if (!this.listening || (this.Form == null)) { return; } this.Form.SourceTableOperationsNotify -= new EventHandler<NavRecordEventArgs>(this.RecordNotify); this.savedRecord.Dispose(); this.savedRecord = null; this.listening = false; }
/// <summary> /// Initializes a new instance of the NsTableDataAccess class. /// </summary> /// <param name="record">The record.</param> internal NsTableDataAccess(NavRecord record) { this.record = record; }
/// <summary> /// Initializes a new instance of the NsTableDataAccess class. /// </summary> /// <param name="recordId">The record ID.</param> internal NsTableDataAccess(Int32 recordId) { // Note, that there is no parent obeject avaiable for this NavRecord creation this.record = NavEnvironment.Instance.ApplicationFactory.GetTable(recordId, null); }