Example #1
0
 /// <summary>
 /// Handles the xCore message to go to a reversal entry.
 /// </summary>
 /// <param name="argument">The xCore Command object.</param>
 /// <returns>true</returns>
 public bool OnGotoReversalEntry(object argument)
 {
     CheckDisposed();
     using (var dlg = new ReversalEntryGoDlg())
     {
         dlg.ReversalIndex = Entry.ReversalIndex;
         var cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
         dlg.SetDlgInfo(cache, null, m_mediator);                 // , false
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             // Can't Go to a subentry, so we have to go to its main entry.
             var selEntry = (IReversalIndexEntry)dlg.SelectedObject;
             m_mediator.BroadcastMessageUntilHandled("JumpToRecord", selEntry.MainEntry.Hvo);
         }
     }
     return(true);
 }
Example #2
0
        public bool OnMoveReversalindexEntry(object cmd)
        {
            using (var dlg = new ReversalEntryGoDlg())
            {
                Slice slice = m_dataEntryForm.CurrentSlice;
                Debug.Assert(slice != null, "No slice was current");
                var currentEntry = (IReversalIndexEntry)slice.Object;
                dlg.ReversalIndex = currentEntry.ReversalIndex;
                dlg.FilteredReversalEntries.Add(currentEntry);
                IReversalIndexEntry owningEntry = currentEntry.OwningEntry;
                if (owningEntry != null)
                {
                    dlg.FilteredReversalEntries.Add(owningEntry);
                }
                dlg.SetHelpTopic("khtpMoveReversalEntry");
                var wp = new WindowParams {
                    m_btnText = LexEdStrings.ks_MoveEntry, m_title = LexEdStrings.ksMoveRevEntry
                };
                var cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
                dlg.SetDlgInfo(cache, wp, m_mediator);
                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    var newOwner = (IReversalIndexEntry)dlg.SelectedObject;
                    UndoableUnitOfWorkHelper.Do(LexEdStrings.ksUndoMoveRevEntry,
                                                LexEdStrings.ksRedoMoveRevEntry, Cache.ActionHandlerAccessor,
                                                () =>
                    {
                        newOwner.MoveIfNeeded(currentEntry);
                        newOwner.SubentriesOC.Add(currentEntry);
                    });
                    RecordClerk clerk = m_mediator.PropertyTable.GetValue("ActiveClerk") as RecordClerk;
                    if (clerk != null)
                    {
                        clerk.RemoveItemsFor(currentEntry.Hvo);
                    }
                    // Note: PropChanged should happen on the old owner and the new while completing the unit of work.
                    // Have to jump to a main entry, as RecordClerk doesn't know anything about subentries.
                    m_mediator.BroadcastMessageUntilHandled("JumpToRecord", newOwner.MainEntry.Hvo);
                }
            }

            return(true);
        }
        public bool OnMoveReversalindexEntry(object cmd)
        {
            using (ReversalEntryGoDlg dlg = new ReversalEntryGoDlg())
            {
                Slice slice = m_dataEntryForm.CurrentSlice;
                Debug.Assert(slice != null, "No slice was current");
                IReversalIndexEntry        currentEntry    = (IReversalIndexEntry)slice.Object;
                List <IReversalIndexEntry> filteredEntries = new List <IReversalIndexEntry>();
                filteredEntries.Add(currentEntry);
                IReversalIndexEntry owningEntry = currentEntry.OwningEntry;
                if (owningEntry != null)
                {
                    filteredEntries.Add(owningEntry);
                }

                WindowParams wp = new WindowParams();
                wp.m_btnText = LexEdStrings.ks_MoveEntry;
                wp.m_label   = LexEdStrings.ks_Find_;
                wp.m_title   = LexEdStrings.ksMoveRevEntry;
                dlg.SetDlgInfo(m_mediator, wp, filteredEntries);                 // , true
                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    FdoCache            cache    = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
                    IReversalIndexEntry newOwner = ReversalIndexEntry.CreateFromDBObject(cache, dlg.SelectedID);
                    cache.BeginUndoTask(LexEdStrings.ksUndoMoveRevEntry,
                                        LexEdStrings.ksRedoMoveRevEntry);
                    ICmObject newOwningObj = newOwner.MoveIfNeeded(currentEntry);
                    newOwner.SubentriesOC.Add(currentEntry);
                    cache.EndUndoTask();
                    RecordClerk clerk = m_mediator.PropertyTable.GetValue("ActiveClerk") as RecordClerk;
                    if (clerk != null)
                    {
                        clerk.RemoveItemsFor(currentEntry.Hvo);
                    }
                    // Note: PropChanged should happen on the old owner and the new in the 'Add" method call.
                    // Have to jump to a main entry, as RecordClerk doesn't know anything about subentries.
                    m_mediator.BroadcastMessageUntilHandled("JumpToRecord", newOwner.MainEntry.Hvo);
                }
            }

            return(true);
        }
Example #4
0
        /// <summary>
        /// Handles the xCore message to go to a reversal entry.
        /// </summary>
        /// <param name="argument">The xCore Command object.</param>
        /// <returns>true</returns>
        public bool OnGotoReversalEntry(object argument)
        {
            CheckDisposed();

            using (ReversalEntryGoDlg dlg = new ReversalEntryGoDlg())
            {
                List <IReversalIndexEntry> filteredEntries = new List <IReversalIndexEntry>();
                filteredEntries.Add(Entry);
                WindowParams wp = new WindowParams();
                wp.m_btnText = LexEdStrings.ks_GoTo;
                wp.m_label   = LexEdStrings.ks_Find_;
                wp.m_title   = LexEdStrings.ksFindRevEntry;
                dlg.SetDlgInfo(m_mediator, wp, filteredEntries);                 // , false
                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    // Can't Go to a subentry, so we have to go to its main entry.
                    FdoCache            cache    = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
                    IReversalIndexEntry selEntry = ReversalIndexEntry.CreateFromDBObject(cache, dlg.SelectedID);
                    m_mediator.BroadcastMessageUntilHandled("JumpToRecord", selEntry.MainEntry.Hvo);
                }
            }
            return(true);
        }
		public bool OnMoveReversalindexEntry(object cmd)
		{
			using (var dlg = new ReversalEntryGoDlg())
			{
				Slice slice = m_dataEntryForm.CurrentSlice;
				Debug.Assert(slice != null, "No slice was current");
				var currentEntry = (IReversalIndexEntry) slice.Object;
				dlg.ReversalIndex = currentEntry.ReversalIndex;
				AddEntryAndChildrenRecursively(dlg.FilteredReversalEntryHvos, currentEntry);
				IReversalIndexEntry owningEntry = currentEntry.OwningEntry;
				if (owningEntry != null)
					dlg.FilteredReversalEntryHvos.Add(owningEntry.Hvo);
				dlg.SetHelpTopic("khtpMoveReversalEntry");
				var wp = new WindowParams {m_btnText = LexEdStrings.ks_MoveEntry, m_title = LexEdStrings.ksMoveRevEntry};
				var cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
				dlg.SetDlgInfo(cache, wp, m_mediator);
				if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
				{
					var newOwner = (IReversalIndexEntry) dlg.SelectedObject;
					UndoableUnitOfWorkHelper.Do(LexEdStrings.ksUndoMoveRevEntry,
						LexEdStrings.ksRedoMoveRevEntry, Cache.ActionHandlerAccessor,
						() =>
						{
							newOwner.MoveIfNeeded(currentEntry);
							newOwner.SubentriesOS.Add(currentEntry);
						});
					RecordClerk clerk = m_mediator.PropertyTable.GetValue("ActiveClerk") as RecordClerk;
					if (clerk != null)
						clerk.RemoveItemsFor(currentEntry.Hvo);
					// Note: PropChanged should happen on the old owner and the new while completing the unit of work.
					// Have to jump to a main entry, as RecordClerk doesn't know anything about subentries.
					m_mediator.BroadcastMessageUntilHandled("JumpToRecord", newOwner.MainEntry.Hvo);
				}
			}
			return true;
		}
		public bool OnMoveReversalindexEntry(object cmd)
		{
			using (ReversalEntryGoDlg dlg = new ReversalEntryGoDlg())
			{
				Slice slice = m_dataEntryForm.CurrentSlice;
				Debug.Assert(slice != null, "No slice was current");
				IReversalIndexEntry currentEntry = (IReversalIndexEntry)slice.Object;
				List<IReversalIndexEntry> filteredEntries = new List<IReversalIndexEntry>();
				filteredEntries.Add(currentEntry);
				IReversalIndexEntry owningEntry = currentEntry.OwningEntry;
				if (owningEntry != null)
					filteredEntries.Add(owningEntry);

				WindowParams wp = new WindowParams();
				wp.m_btnText = LexEdStrings.ks_MoveEntry;
				wp.m_label = LexEdStrings.ks_Find_;
				wp.m_title = LexEdStrings.ksMoveRevEntry;
				dlg.SetDlgInfo(m_mediator, wp, filteredEntries); // , true
				if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
				{
					FdoCache cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
					IReversalIndexEntry newOwner = ReversalIndexEntry.CreateFromDBObject(cache, dlg.SelectedID);
					cache.BeginUndoTask(LexEdStrings.ksUndoMoveRevEntry,
						LexEdStrings.ksRedoMoveRevEntry);
					ICmObject newOwningObj = newOwner.MoveIfNeeded(currentEntry);
					newOwner.SubentriesOC.Add(currentEntry);
					cache.EndUndoTask();
					RecordClerk clerk = m_mediator.PropertyTable.GetValue("ActiveClerk") as RecordClerk;
					if (clerk != null)
						clerk.RemoveItemsFor(currentEntry.Hvo);
					// Note: PropChanged should happen on the old owner and the new in the 'Add" method call.
					// Have to jump to a main entry, as RecordClerk doesn't know anything about subentries.
					m_mediator.BroadcastMessageUntilHandled("JumpToRecord", newOwner.MainEntry.Hvo);
				}
			}

			return true;
		}
Example #7
0
		/// <summary>
		/// Handles the xCore message to go to a reversal entry.
		/// </summary>
		/// <param name="argument">The xCore Command object.</param>
		/// <returns>true</returns>
		public bool OnGotoReversalEntry(object argument)
		{
			CheckDisposed();
			using (var dlg = new ReversalEntryGoDlg())
			{
				dlg.ReversalIndex = Entry.ReversalIndex;
				var cache = (FdoCache) m_mediator.PropertyTable.GetValue("cache");
				dlg.SetDlgInfo(cache, null, m_mediator); // , false
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					// Can't Go to a subentry, so we have to go to its main entry.
					var selEntry = (IReversalIndexEntry) dlg.SelectedObject;
					m_mediator.BroadcastMessageUntilHandled("JumpToRecord", selEntry.MainEntry.Hvo);
				}
			}
			return true;
		}
Example #8
0
		/// <summary>
		/// Handles the xCore message to go to a reversal entry.
		/// </summary>
		/// <param name="argument">The xCore Command object.</param>
		/// <returns>true</returns>
		public bool OnGotoReversalEntry(object argument)
		{
			CheckDisposed();

			using (ReversalEntryGoDlg dlg = new ReversalEntryGoDlg())
			{
				List<IReversalIndexEntry> filteredEntries = new List<IReversalIndexEntry>();
				filteredEntries.Add(Entry);
				WindowParams wp = new WindowParams();
				wp.m_btnText = LexEdStrings.ks_GoTo;
				wp.m_label = LexEdStrings.ks_Find_;
				wp.m_title = LexEdStrings.ksFindRevEntry;
				dlg.SetDlgInfo(m_mediator, wp, filteredEntries); // , false
				if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
				{
					// Can't Go to a subentry, so we have to go to its main entry.
					FdoCache cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
					IReversalIndexEntry selEntry = ReversalIndexEntry.CreateFromDBObject(cache, dlg.SelectedID);
					m_mediator.BroadcastMessageUntilHandled("JumpToRecord", selEntry.MainEntry.Hvo);
				}
			}
			return true;
		}