当前位置: 首页>>代码示例>>C#>>正文


C# Mediator.AddColleague方法代码示例

本文整理汇总了C#中XCore.Mediator.AddColleague方法的典型用法代码示例。如果您正苦于以下问题:C# Mediator.AddColleague方法的具体用法?C# Mediator.AddColleague怎么用?C# Mediator.AddColleague使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XCore.Mediator的用法示例。


在下文中一共展示了Mediator.AddColleague方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

		/// <summary>
		/// Initialize this has an IxCoreColleague
		/// </summary>
		/// <param name="mediator"></param>
		/// <param name="configurationParameters"></param>
		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();

			m_mediator = mediator;
			mediator.AddColleague(this);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:12,代码来源:Tester.cs

示例2: Init

		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();

			_mediator = mediator;
			Cache = (FdoCache)_mediator.PropertyTable.GetValue("cache");
			_mediator.PropertyTable.SetProperty("FLExBridgeListener", this);
			_mediator.PropertyTable.SetPropertyPersistence("FLExBridgeListener", false);
			_parentForm = (Form)_mediator.PropertyTable.GetValue("window");
			mediator.AddColleague(this);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:FLExBridgeListener.cs

示例3: Init

		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();

			m_mediator = mediator;
			m_cache = (FdoCache) m_mediator.PropertyTable.GetValue("cache");
			mediator.AddColleague(this);

			m_sda = m_cache.MainCacheAccessor;
			m_sda.AddNotification(this);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:ParserListener.cs

示例4: Init

		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();
			this.mediator = mediator; //allows the Cache property to function

			string name = XmlUtils.GetAttributeValue(configurationParameters, "clerk");
			var clerk = RecordClerk.FindClerk(mediator, name);
			m_clerk = (clerk == null || clerk is TemporaryRecordClerk) ?
				(InterlinearTextsRecordClerk)RecordClerkFactory.CreateClerk(mediator, configurationParameters, true) :
				(InterlinearTextsRecordClerk)clerk;
			// There's no record bar for it to control, but it should control the staus bar (e.g., it should update if we change
			// the set of selected texts).
			m_clerk.ActivateUI(true);
			_areaName = XmlUtils.GetOptionalAttributeValue(configurationParameters, "area", "unknown");
			RebuildStatisticsTable();
			//add ourselves so that we can receive messages (related to the text selection currently misnamed AddTexts)
			mediator.AddColleague(this);
			//add our current state to the history system
			string toolName = mediator.PropertyTable.GetStringProperty("currentContentControl", "");
			mediator.SendMessage("AddContextToHistory", new FwLinkArgs(toolName, Guid.Empty), false);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:21,代码来源:StatisticsView.cs

示例5: Window

		public Window()
		{
			InitializeComponent();

			m_mainPaneText = new Label();
			m_mainPaneText.Text = "No item was yet clicked.";
			m_mainPaneText.Dock = DockStyle.Right;

			string[] iconLabels = { "iconName" };
			var imagelist = new ImageList();
			var itemIcon = new Bitmap(32, 32);
			for(int x = 0; x < itemIcon.Width; ++x)
				for (int y = 0; y < itemIcon.Height; ++y)
					itemIcon.SetPixel(x, y, Color.Blue);

			imagelist.Images.Add(itemIcon);

			m_smallImages.AddList(imagelist, iconLabels);
			m_largeImages.AddList(imagelist, iconLabels);

			m_mediator = new Mediator();
			m_mediator.StringTbl = new SIL.Utils.StringTable("../../DistFiles/Language Explorer/Configuration");
			m_sidebarAdapter = new SidebarAdapter();
			m_sidebar = m_sidebarAdapter.Init(this, m_smallImages, m_largeImages, m_mediator);

			m_sidebarChoiceGroupCollection = new MyChoiceGroupCollection(m_mediator, m_sidebarAdapter, null);
			m_sidebarChoiceGroupCollection.Init();

			this.Controls.Add(m_sidebar);
			this.Controls.Add(m_mainPaneText);
			m_sidebarAdapter.FinishInit();

			((IUIAdapter)m_sidebarAdapter).OnIdle();
			m_mediator.SendMessage("Idle", null);

			m_mediator.AddColleague(new MyCoreColleague(m_mainPaneText));
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:37,代码来源:Window.cs

示例6: Init

        public void Init(Mediator mediator, XmlNode configurationParameters)
        {
            CheckDisposed();

            m_mediator = mediator;
            mediator.AddColleague(this);
            mediator.PropertyTable.SetProperty("LinkListener", this);
            mediator.PropertyTable.SetPropertyPersistence("LinkListener", false);
        }
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:9,代码来源:LinkListener.cs

示例7: Init

		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();
			m_mediator = mediator;
			mediator.AddColleague(this);
			mediator.PropertyTable.SetProperty("ContextHelper", this,false);
			mediator.PropertyTable.SetPropertyPersistence("ContextHelper",false);


			this.ParentControl = (Control)m_mediator.PropertyTable.GetValue("window");
			m_document= new XmlDocument();

			//we use the  directory of the file which held are parameters as the starting point
			//of the path we were given.
			string path = XmlUtils.GetManditoryAttributeValue(configurationParameters, "contextHelpPath");
			path =System.IO.Path.Combine( System.IO.Path.GetDirectoryName(configurationParameters.BaseURI), path);
			m_document.Load(path);
			//m_items = m_document.SelectNodes("strings/item");

			ShowAlways=m_mediator.PropertyTable.GetBoolProperty("ShowBalloonHelp", true);

		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:22,代码来源:BaseContextHelper.cs

示例8: Init

		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();

			m_mediator = mediator;
			mediator.AddColleague(this);
			FdoCache cache = (FdoCache) m_mediator.PropertyTable.GetValue("cache");
			//don't know just what good having this default is, but it's at least safer
			mediator.PropertyTable.SetProperty("WritingSystemHvo", cache.LangProject.DefaultAnalysisWritingSystem.ToString());
			mediator.PropertyTable.SetPropertyPersistence("WritingSystemHvo", false);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:11,代码来源:TextListeners.cs

示例9: Init

        /// <summary></summary>
        public void Init(Mediator mediator, XmlNode configurationParameters)
        {
            m_mediator = mediator;
            mediator.AddColleague(this);

            areasLabel = m_mediator.StringTbl.LocalizeAttributeValue("Areas");

            m_sidepane = new SidePane(MyControl, SidePaneItemAreaStyle.List);
            m_sidepane.AccessibilityObject.Name = "sidepane";
                //m_sidepane.GetType().Name;
            m_sidepane.ItemClicked += SidePaneItemClickedHandler;
            m_sidepane.TabClicked += SidePaneTabClickedHandler;
        }
开发者ID:sillsdev,项目名称:CarlaLegacy,代码行数:14,代码来源:NavBarAdapter.cs

示例10: InitBase

		/// <summary>
		/// Initialize this as an IxCoreColleague
		/// </summary>
		/// <remarks> subclasses must call this from their Init.
		/// This was done, rather than providing an Init() here in the normal way,
		/// to drive home the point that the subclass must set m_fullyInitialized
		/// to true when it is fully initialized.</remarks>
		/// <param name="mediator"></param>
		/// <param name="configurationParameters"></param>
		protected void InitBase(Mediator mediator, XmlNode configurationParameters)
		{
			Debug.Assert(m_fullyInitialized == false, "No way we are fully initialized yet!");

			m_mediator = mediator;
			m_configurationParameters = configurationParameters;

			ReadParameters();

			RecordClerk clerk = ExistingClerk;
			bool fClerkAlreadySuppressed = false;
			bool fClerkWasCreated = false;
			if (clerk == null)
			{
				// We do NOT want to load the list as part of creating the clerk.
				// At earliest, we want to do so only when the ListUpdateHelper is disposed,
				// after the clerk and list are sufficiently initialized (e.g., with saved sorting and filtering
				// information) to sort correctly. This is part of a fairly convoluted attempt to prevent
				// sorting the list repeatedly during startup, even though startup involves many events
				// that normally require it to be resorted.
				// In this case the clerk will be created with its list already in the ListLoadingSuppressed state,
				// and already set to indicate that loading is necessary when suppression ends;
				// we want to pass FALSE to the ListUpdateHelper constructor, however, to pretend that the
				// list was NOT suppressed when the helper was created, so it will duly be sorted when
				// the helper is disposed.
				fClerkWasCreated = true;
				clerk = CreateClerk(false);
				Debug.Assert(clerk != null);
			}
			else
				fClerkAlreadySuppressed = clerk.ListLoadingSuppressed; // If we didn't create the clerk, someone else might have suppressed it.
			// suspend any loading of the Clerk's list items until after a
			// subclass (possibly) initializes sorters/filters
			// in SetupDataContext()
			bool didRestoreFromPersistence = false;
			using (var luh = new RecordClerk.ListUpdateHelper(clerk, fClerkAlreadySuppressed))
			{
				luh.ClearBrowseListUntilReload = true;
				clerk.UpdateOwningObjectIfNeeded();
				SetTreebarAvailability();
				AddPaneBar();

				//Historical comments here indicated that the Clerk should be processed by the mediator before the
				//view. This is handled by Priority now, RecordView is by default just after RecordClerk in the processing.
				mediator.AddColleague(this);
				SetupDataContext();
				// Only if it was just now created should we try to restore from what we persisted.
				// Otherwise (e.g., FWR-1128) we may miss changes made to the list in other tools.
				if (fClerkWasCreated)
					didRestoreFromPersistence = RestoreSortSequence();
				if (didRestoreFromPersistence)
					luh.ListWasRestored();
			}
			// In case it hasn't yet been loaded, load it!  See LT-10185.
			if (!didRestoreFromPersistence && !Clerk.ListLoadingSuppressed && Clerk.RequestedLoadWhileSuppressed)
				Clerk.UpdateList(true, true); // sluggishness culprit for LT-12844 was in here
			Clerk.SetCurrentFromRelatedClerk(); // See if some other clerk wants to influence our current object.
			ShowRecord();
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:68,代码来源:RecordView.cs

示例11: Init

        /// <summary>
        /// Initialize the IxCoreColleague object.
        /// </summary>
        public virtual void Init(Mediator mediator, XmlNode configurationParameters)
        {
            CheckDisposed();

            m_mediator = mediator;
            mediator.AddColleague(this);
            m_configurationParameters = configurationParameters;
            m_persistProvider = new XCore.PersistenceProvider(PersistentLabel, m_mediator.PropertyTable);
        }
开发者ID:sillsdev,项目名称:CarlaLegacy,代码行数:12,代码来源:AreaManager.cs

示例12: Init

		/// <summary>
		/// Initialize.
		/// </summary>
		/// <param name="mediator"></param>
		/// <param name="configurationParameters"></param>
		public virtual void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();

			m_mediator = mediator;
			base.m_configurationParameters = configurationParameters;
			mediator.AddColleague(this);
			string urlAttr = XmlUtils.GetManditoryAttributeValue(m_configurationParameters, "URL");
			m_htmlControl.URL = GetInstallSubDirectory(urlAttr);

		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:16,代码来源:HtmlViewer.cs

示例13: Init

		public virtual void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();

			m_mediator = mediator;
			m_configurationParameters = configurationParameters;
			m_mediator.AddColleague(this);

			var cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache");
			cache.DomainDataByFlid.BeginNonUndoableTask();
			var usedWses = new List<IWritingSystem>();
			foreach (IReversalIndex rev in cache.LanguageProject.LexDbOA.ReversalIndexesOC)
			{
				var ws = cache.ServiceLocator.WritingSystemManager.get_Engine(rev.WritingSystem);
				usedWses.Add((IWritingSystem)ws);
				if (rev.PartsOfSpeechOA == null)
					rev.PartsOfSpeechOA = cache.ServiceLocator.GetInstance<ICmPossibilityListFactory>().Create();
				rev.PartsOfSpeechOA.ItemClsid = PartOfSpeechTags.kClassId;
			}
			List<IReversalIndex> corruptReversalIndices = new List<IReversalIndex>();
			foreach (IReversalIndex rev in cache.LanguageProject.LexDbOA.ReversalIndexesOC)
			{
				// Make sure each index has a name, if it is available from the writing system.
				if (string.IsNullOrEmpty(rev.WritingSystem))
				{
					// Delete a bogus IReversalIndex that has no writing system.
					// But, for now only store them for later deletion,
					// as immediate removal will wreck the looping.
					corruptReversalIndices.Add(rev);
					continue;
				}
				IWritingSystem revWs = cache.ServiceLocator.WritingSystemManager.Get(rev.WritingSystem);
				// TODO WS: is DisplayLabel the right thing to use here?
				rev.Name.SetAnalysisDefaultWritingSystem(revWs.DisplayLabel);
			}
			// Delete any corrupt reversal indices.
			foreach (IReversalIndex rev in corruptReversalIndices)
			{
				MessageBox.Show("Need to delete a corrupt reversal index (no writing system)", "Self-correction");
				cache.LangProject.LexDbOA.ReversalIndexesOC.Remove(rev);	// does this accomplish anything?
			}

			// Set up for the reversal index combo box or dropdown menu.
			Guid firstGuid = Guid.Empty;
			List<IReversalIndex> reversalIds = cache.LanguageProject.LexDbOA.CurrentReversalIndices;
			if (reversalIds.Count > 0)
				firstGuid = reversalIds[0].Guid;
			else if (cache.LanguageProject.LexDbOA.ReversalIndexesOC.Count > 0)
				firstGuid = cache.LanguageProject.LexDbOA.ReversalIndexesOC.ToGuidArray()[0];
			if (firstGuid != Guid.Empty)
			{
				SetReversalIndexGuid(firstGuid);
			}
			cache.DomainDataByFlid.EndNonUndoableTask();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:55,代码来源:ReversalListener.cs

示例14: EmptyScripture

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="EmptyScripture"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public EmptyScripture(ITMAdapter adapter, FdoCache fdoCache, IHelpTopicProvider helpTopicProvider)
		{
			InitializeComponent();

			m_helpTopicProvider = helpTopicProvider;

			if (adapter == null || adapter.MessageMediator == null)
				btnBook.Enabled = false;
			else
			{
				m_tmAdapter = adapter;

				// Save the adapter's message mediator so it can be restored when the
				// dialog closes.
				m_savMsgMediator = adapter.MessageMediator;

				// Create a new mediator for this dialog and set
				// the adapter's mediator to it.
				Mediator mediator = new Mediator();
				mediator.AddColleague(this);
				m_tmAdapter.MessageMediator = mediator;
			}

			string projectName = fdoCache.ProjectId.Name;
			lblTopLabel.Text = string.Format(lblTopLabel.Text,projectName);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:31,代码来源:EmptyScripture.cs

示例15: Init

		/// <summary>
		/// Initialize the IxCoreColleague object.
		/// </summary>
		public void Init(Mediator mediator, XmlNode configurationParameters)
		{
			CheckDisposed();

			m_mediator = mediator;
			mediator.AddColleague(this);
			if (m_mediator.PropertyTable != null)
				m_persistProvider = new PersistenceProvider(m_ksTryAWord, m_mediator.PropertyTable);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:12,代码来源:ParseWordDlg.cs


注:本文中的XCore.Mediator.AddColleague方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。