Exemplo n.º 1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This function will drop down the redo list box
		/// </summary>
		/// <param name="args"></param>
		/// <returns><c>true</c></returns>
		/// ------------------------------------------------------------------------------------
		protected bool OnDropDownEditRedo(object args)
		{
			ToolBarPopupInfo popupInfo = args as ToolBarPopupInfo;
			if (popupInfo == null)
				return false;

			m_UndoRedoDropDown = new UndoRedoDropDown(
				ResourceHelper.GetResourceString("kstidRedo1Action"),
				ResourceHelper.GetResourceString("kstidRedoMultipleActions"),
				ResourceHelper.GetResourceString("kstidUndoRedoCancel"));

			for (int i = 0; i < m_cache.ActionHandlerAccessor.RedoableSequenceCount; i++)
			{
				string redoText = m_cache.ActionHandlerAccessor.GetRedoTextN(i);
				Debug.Assert(!String.IsNullOrEmpty(redoText));
				m_UndoRedoDropDown.Actions.Add(redoText.Replace("&", String.Empty));
			}

			m_UndoRedoDropDown.ItemClick += OnRedoDropDownClicked;

			m_UndoRedoDropDown.AdjustHeight();
			popupInfo.Control = m_UndoRedoDropDown;
			return true;
		}
Exemplo n.º 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This function will drop down the redo list box
		/// </summary>
		/// <param name="args"></param>
		/// <returns><c>true</c></returns>
		/// ------------------------------------------------------------------------------------
		protected bool OnDropDownEditRedo(object args)
		{
			ToolBarPopupInfo popupInfo = args as ToolBarPopupInfo;
			if (popupInfo == null)
				return false;

			m_UndoRedoDropDown = new UndoRedoDropDown(
				FwApp.GetResourceString("kstidRedo1Action"),
				FwApp.GetResourceString("kstidRedoMultipleActions"),
				FwApp.GetResourceString("kstidUndoRedoCancel"));

			for (int i = 0; i < m_cache.ActionHandlerAccessor.RedoableSequenceCount; i++)
			{
				string redoText = m_cache.ActionHandlerAccessor.GetRedoTextN(i);
				m_UndoRedoDropDown.Actions.Add(redoText == null ?
					FwApp.GetResourceString("kstidUnknownRedo") : redoText.Replace("&", ""));
			}

			m_UndoRedoDropDown.ItemClick +=
				new UndoRedoDropDown.ClickEventHandler(OnRedoDropDownClicked);

			m_UndoRedoDropDown.AdjustHeight();
			popupInfo.Control = m_UndoRedoDropDown;
			return true;
		}
Exemplo n.º 3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This function will drop down the undo list box
		/// </summary>
		/// <param name="args"></param>
		/// <returns><c>true</c> if handled, otherwise <c>false</c></returns>
		/// ------------------------------------------------------------------------------------
		protected virtual bool OnDropDownEditUndo(object args)
		{
			ToolBarPopupInfo popupInfo = args as ToolBarPopupInfo;
			if (popupInfo == null)
				return false;

			m_UndoRedoDropDown = new UndoRedoDropDown(
				ResourceHelper.GetResourceString("kstidUndo1Action"),
				ResourceHelper.GetResourceString("kstidUndoMultipleActions"),
				ResourceHelper.GetResourceString("kstidUndoRedoCancel"));

			for (int i = m_cache.ActionHandlerAccessor.UndoableSequenceCount - 1;
				i >= m_preMarkUndoSeqCount; i--)
			{
				string undoText = m_cache.ActionHandlerAccessor.GetUndoTextN(i);
				Debug.Assert(!String.IsNullOrEmpty(undoText));
				m_UndoRedoDropDown.Actions.Add(undoText.Replace("&", String.Empty));
			}

			m_UndoRedoDropDown.ItemClick +=
				new UndoRedoDropDown.ClickEventHandler(OnUndoDropDownClicked);

			m_UndoRedoDropDown.AdjustHeight();
			popupInfo.Control = m_UndoRedoDropDown;
			return true;
		}