SIL.FieldWorks.XWorks.DTMenuHandler.Init C# (CSharp) Method

Init() public method

public Init ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
mediator XCore.Mediator
configurationParameters System.Xml.XmlNode
return void
		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			m_mediator = mediator;
			m_configuration = configurationParameters;
		}

Usage Example

Example #1
0
		protected override void SetupDataContext()
		{
			Debug.Assert(m_configurationParameters != null);

			base.SetupDataContext();

			//this will normally be the same name as the view, e.g. "basicEdit". This plus the name of the vector
			//should give us a unique context for the dataTree control parameters.

			string persistContext = XmlUtils.GetOptionalAttributeValue(m_configurationParameters, "persistContext");

			if (persistContext !="")
				persistContext=m_vectorName+"."+persistContext+".DataTree";
			else
				persistContext=m_vectorName+".DataTree";

			m_dataEntryForm.PersistenceProvder = new PersistenceProvider(persistContext, m_mediator.PropertyTable);

			Clerk.UpdateRecordTreeBarIfNeeded();
			SetupSliceFilter();
			m_dataEntryForm.Dock = DockStyle.Fill;
			m_dataEntryForm.StringTbl = StringTbl;
			m_dataEntryForm.SmallImages =(ImageCollection) m_mediator.PropertyTable.GetValue("smallImages");
			string sDatabase = Cache.ProjectId.Name;
			m_dataEntryForm.Initialize(Cache, true, Inventory.GetInventory("layouts", sDatabase),
				Inventory.GetInventory("parts", sDatabase));
			m_dataEntryForm.Init(m_mediator, m_configurationParameters);
			if (m_dataEntryForm.AccessibilityObject != null)
				m_dataEntryForm.AccessibilityObject.Name = "RecordEditView.DataTree";
			//set up the context menu, overriding the automatic menu creator/handler

			m_menuHandler = DTMenuHandler.Create(m_dataEntryForm, m_configurationParameters);
			m_menuHandler.Init(m_mediator, m_configurationParameters);

//			m_dataEntryForm.SetContextMenuHandler(new SliceMenuRequestHandler((m_menuHandler.GetSliceContextMenu));
			m_dataEntryForm.SetContextMenuHandler(m_menuHandler.ShowSliceContextMenu);

			Controls.Add(m_dataEntryForm);
			m_dataEntryForm.BringToFront();
		}