/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Called when the add button is pressed
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		/// ------------------------------------------------------------------------------------
		protected void m_btnAdd_Click(object sender, System.EventArgs e)
		{
			IPubHFSet HFSet = m_cache.ServiceLocator.GetInstance<IPubHFSetFactory>().Create();
			m_HfSetOwner.HeaderFooterSetsOC.Add(HFSet);
			IPubHeaderFactory phFactory = m_cache.ServiceLocator.GetInstance<IPubHeaderFactory>();
			HFSet.DefaultFooterOA = phFactory.Create();
			HFSet.DefaultHeaderOA = phFactory.Create();
			HFSet.FirstFooterOA = phFactory.Create();
			HFSet.FirstHeaderOA = phFactory.Create();
			HFSet.EvenFooterOA = phFactory.Create();
			HFSet.EvenHeaderOA = phFactory.Create();

			using (HeaderFooterModifyDlg dlg = new HeaderFooterModifyDlg(m_cache, HFSet as IPubHFSet, m_pub, m_helpProvider))
			{
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					UpdateNameBox(null);
					UpdatePreView();
				}
				else
				{
					// We don't want a new PubHFSet after all...
					m_cache.DomainDataByFlid.DeleteObj(HFSet.Hvo);
				}
			}
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Called when the modify button is pressed
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		/// ------------------------------------------------------------------------------------
		protected void m_btnModify_Click(object sender, System.EventArgs e)
		{
			using (HeaderFooterModifyDlg dlg = new HeaderFooterModifyDlg(m_cache, CurrentHFSet,
					   m_pub, m_helpProvider))
			{
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					if (!m_modifiedHFSets.Contains(CurrentHFSet.Hvo))
						m_modifiedHFSets.Add(CurrentHFSet.Hvo);

					UpdatePreView();
					UpdateNameBox(CurrentHFSet.Name);
				}
			}
		}
示例#3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Called when the add button is pressed
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		/// ------------------------------------------------------------------------------------
		protected void m_btnAdd_Click(object sender, System.EventArgs e)
		{
			PubHFSet HFSet = new PubHFSet();
			m_HfSetOwner.HeaderFooterSetsOC.Add(HFSet);
			HFSet.DefaultFooterOA = new PubHeader();
			HFSet.DefaultHeaderOA = new PubHeader();
			HFSet.FirstFooterOA = new PubHeader();
			HFSet.FirstHeaderOA = new PubHeader();
			HFSet.EvenFooterOA = new PubHeader();
			HFSet.EvenHeaderOA = new PubHeader();

			using (HeaderFooterModifyDlg dlg = new HeaderFooterModifyDlg(m_cache, HFSet as IPubHFSet, m_pub, m_helpProvider))
			{
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					UpdateNameBox(null);
					UpdatePreView();
				}
				else
				{
					// We don't want a new PubHFSet after all...
					m_cache.DeleteObject(HFSet.Hvo);
				}
			}
		}