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


C# XCore.Mediator类代码示例

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


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

示例1: Initialize

		public void Initialize(ICmObject rootObj, int rootFlid, string rootFieldName, FdoCache cache, string displayNameProperty,
			Mediator mediator, string displayWs)
		{
			CheckDisposed();
			m_displayWs = displayWs;
			Initialize(rootObj, rootFlid, rootFieldName, cache, displayNameProperty, mediator);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:7,代码来源:VectorReferenceView.cs

示例2: InterAreaBookmark

		internal InterAreaBookmark(InterlinMaster interlinMaster, Mediator mediator, FdoCache cache)	// For restoring
		{
			// Note: resist any temptation to save mediator in a memer variable. Bookmarks are kept in a static dictionary
			// and may well have a longer life than the mediator. There is danger of using if after it is disposed. See LT-12435.
			Init(interlinMaster, cache);
			Restore(interlinMaster.IndexOfTextRecord, mediator);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:7,代码来源:InterAreaBookmark.cs

示例3: PossibilityAutoComplete

		public PossibilityAutoComplete(FdoCache cache, Mediator mediator, ICmPossibilityList list, Control control,
			string displayNameProperty, string displayWs)
		{
			m_cache = cache;
			m_mediator = mediator;
			m_control = control;
			m_displayNameProperty = displayNameProperty;
			m_displayWs = displayWs;

			m_listBox = new ComboListBox {DropDownStyle = ComboBoxStyle.DropDownList, ActivateOnShow = false};
			m_listBox.SelectedIndexChanged += HandleSelectedIndexChanged;
			m_listBox.SameItemSelected += HandleSameItemSelected;
			m_listBox.StyleSheet = FontHeightAdjuster.StyleSheetFromMediator(mediator);
			m_listBox.WritingSystemFactory = cache.WritingSystemFactory;
			m_searcher = new StringSearcher<ICmPossibility>(SearchType.Prefix, cache.ServiceLocator.WritingSystemManager);
			m_possibilities = new List<ICmPossibility>();
			var stack = new Stack<ICmPossibility>(list.PossibilitiesOS);
			while (stack.Count > 0)
			{
				ICmPossibility poss = stack.Pop();
				m_possibilities.Add(poss);
				foreach (ICmPossibility child in poss.SubPossibilitiesOS)
					stack.Push(child);
			}

			m_control.KeyDown += HandleKeyDown;
			m_control.KeyPress += HandleKeyPress;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:28,代码来源:PossibilityAutoComplete.cs

示例4: ChoiceRelatedClass

		public ChoiceRelatedClass(Mediator mediator,  IUIAdapter adapter, XmlNode configurationNode)
		{
			m_adapter = adapter;
			m_mediator = mediator;
			m_configurationNode = configurationNode;
			m_defaultVisible= XmlUtils.GetOptionalBooleanAttributeValue(m_configurationNode, "defaultVisible", true);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:7,代码来源:ChoiceGroup.cs

示例5: MSAPopupTreeManager

		/// <summary>
		/// Constructor.
		/// </summary>
		public MSAPopupTreeManager(PopupTree popupTree, FdoCache cache, ICmPossibilityList list,
			int ws, bool useAbbr, Mediator mediator, Form parent)
			: base(popupTree,  cache, list, ws, useAbbr, parent)
		{
			m_mediator = mediator;
			LoadStrings();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:10,代码来源:MSAPopupTreeManager.cs

示例6: SetDlgInfo

		public void SetDlgInfo(FdoCache cache, Mediator mediator, ICmObject owner)
		{
			CheckDisposed();

			m_cache = cache;
			m_owner = owner;

			m_helpTopic = "khtpDataNotebook-InsertRecordDlg";

			m_helpTopicProvider = mediator.HelpTopicProvider;
			if (m_helpTopicProvider != null) // Will be null when running tests
			{
				m_helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
				m_helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(m_helpTopic));
				m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
			}

			IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(mediator);
			m_titleTextBox.StyleSheet = stylesheet;
			m_titleTextBox.WritingSystemFactory = m_cache.WritingSystemFactory;
			m_titleTextBox.WritingSystemCode = m_cache.DefaultAnalWs;
			AdjustControlAndDialogHeight(m_titleTextBox, m_titleTextBox.PreferredHeight);

			m_typeCombo.StyleSheet = stylesheet;
			m_typeCombo.WritingSystemFactory = m_cache.WritingSystemFactory;
			m_typeCombo.WritingSystemCode = m_cache.DefaultAnalWs;
			AdjustControlAndDialogHeight(m_typeCombo, m_typeCombo.PreferredHeight);

			ICmPossibilityList recTypes = m_cache.LanguageProject.ResearchNotebookOA.RecTypesOA;
			m_typePopupTreeManager = new PossibilityListPopupTreeManager(m_typeCombo, m_cache, mediator,
				recTypes, cache.DefaultAnalWs, false, this);
			m_typePopupTreeManager.LoadPopupTree(m_cache.ServiceLocator.GetObject(RnResearchNbkTags.kguidRecObservation).Hvo);
			// Ensure that we start out focused in the Title text box.  See FWR-2731.
			m_titleTextBox.Select();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:35,代码来源:InsertRecordDlg.cs

示例7: Init

		public void Init(Mediator mediator, XmlNode configurationNode, ICmObject sourceObject)
		{
			CheckDisposed();

			m_cache = sourceObject.Cache;

			// Find the sense owning our LexExampleSentence
			if (sourceObject is LexExampleSentence)
			{
				m_les = sourceObject as LexExampleSentence;
				m_owningSense = LexSense.CreateFromDBObject(m_cache, m_les.OwnerHVO);
			}
			else if (sourceObject is LexSense)
			{
				m_owningSense = sourceObject as ILexSense;
			}
			else
			{
				throw new ArgumentException("Invalid object type for sourceObject.");
			}

			m_mediator = mediator;
			m_configurationNode = configurationNode;
			AddConfigurableControls();

			m_virtFlidReference = BaseVirtualHandler.GetInstalledHandlerTag(m_cache, "CmBaseAnnotation", "Reference");
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:27,代码来源:FindExampleSentenceDlg.cs

示例8: TryAWordSandbox

		/// <summary>
		/// Create a new one.
		/// </summary>
		/// <param name="cache"></param>
		/// <param name="ss"></param>
		/// <param name="choices"></param>
		/// <param name="analysis"></param>
		/// <param name="mediator"></param>
		public TryAWordSandbox(FdoCache cache, Mediator mediator, IVwStylesheet ss, InterlinLineChoices choices,
			IAnalysis analysis)
			: base(cache, mediator, ss, choices)
		{
			SizeToContent = true;
			LoadForWordBundleAnalysis(analysis.Hvo);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:15,代码来源:TryAWordSandbox.cs

示例9: Init

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

			InitBase(mediator, configurationParameters);
			m_fullyInitialized = true;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:12,代码来源:RecordDocView.cs

示例10: RegRuleFormulaVc

		public RegRuleFormulaVc(FdoCache cache, Mediator mediator)
			: base(cache, mediator)
		{
			ITsPropsBldr tpb = TsPropsBldrClass.Create();
			tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000);
			tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault,
				(int)ColorUtil.ConvertColorToBGR(Color.Gray));
			tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter);
			m_ctxtProps = tpb.GetTextProps();

			tpb = TsPropsBldrClass.Create();
			tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 20000);
			tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault,
				(int)ColorUtil.ConvertColorToBGR(Color.Gray));
			tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter);
			tpb.SetIntPropValues((int)FwTextPropType.ktptPadLeading, (int)FwTextPropVar.ktpvMilliPoint, 2000);
			tpb.SetIntPropValues((int)FwTextPropType.ktptPadTrailing, (int)FwTextPropVar.ktpvMilliPoint, 2000);
			tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, MiscUtils.StandardSansSerif);
			tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable);
			m_charProps = tpb.GetTextProps();

			ITsStrFactory tsf = m_cache.TsStrFactory;
			int userWs = m_cache.DefaultUserWs;
			m_arrow = tsf.MakeString("\u2192", userWs);
			m_slash = tsf.MakeString("/", userWs);
			m_underscore = tsf.MakeString("__", userWs);
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:27,代码来源:RegRuleFormulaVc.cs

示例11: SetDlgInfo

		/// <summary>
		/// Set up the dlg in preparation to showing it.
		/// </summary>
		/// <param name="cache">FDO cache.</param>
		/// <param name="wp">Strings used for various items in this dialog.</param>
		public void SetDlgInfo(FdoCache cache, Mediator mediator, WindowParams wp, DummyCmObject mainObj, List<DummyCmObject> mergeCandidates,
			string guiControl, string helpTopic)
		{
			CheckDisposed();

			Debug.Assert(cache != null);

			m_mediator = mediator;
			m_cache = cache;
			m_mainObj = mainObj;
			m_tsf = cache.TsStrFactory;

			m_fwTextBoxBottomMsg.WritingSystemFactory = m_cache.WritingSystemFactory;
			m_fwTextBoxBottomMsg.WritingSystemCode = m_cache.WritingSystemFactory.UserWs;

			InitBrowseView(guiControl, mergeCandidates);

			Text = wp.m_title;
			label2.Text = wp.m_label;

			m_helpTopic = helpTopic;

			if(m_helpTopic != null && m_helpTopicProvider != null) // m_helpTopicProvider could be null for testing
			{
				helpProvider = new HelpProvider();
				helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
				helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(m_helpTopic));
				helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
			}

			MoveWindowToPreviousPosition();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:37,代码来源:MergeObjectDlg.cs

示例12: ArchiveNow

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Prepares the selected files to be uploaded to REAP using RAMP.
		/// </summary>
		/// <param name="owner">RAMP dialog owner</param>
		/// <param name="dialogFont">RAMP dialog font (for localization and consistency)</param>
		/// <param name="localizationDialogIcon"></param>
		/// <param name="filesToArchive"></param>
		/// <param name="mediator"></param>
		/// <param name="thisapp"></param>
		/// <param name="cache"></param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public bool ArchiveNow(Form owner, Font dialogFont, Icon localizationDialogIcon,
			IEnumerable<string> filesToArchive, Mediator mediator, FwApp thisapp, FdoCache cache)
		{
			var viProvider = new VersionInfoProvider(Assembly.LoadFile(thisapp.ProductExecutableFile), false);
			var wsMgr = cache.ServiceLocator.GetInstance<IWritingSystemManager>();
			var appName = thisapp.ApplicationName;
			var title = cache.LanguageProject.ShortName;
			var uiLocale = wsMgr.Get(cache.DefaultUserWs).IcuLocale;
			var projectId = cache.LanguageProject.ShortName;

			var model = new RampArchivingDlgViewModel(Application.ProductName, title, projectId, /*appSpecificArchivalProcessInfo:*/ string.Empty, SetFilesToArchive(filesToArchive), GetFileDescription);

			// image files should be labeled as Graphic rather than Photograph (the default).
			model.ImagesArePhotographs = false;

			// show the count of media files, not the duration
			model.ShowRecordingCountNotLength = true;

			// set the general description, in each available language
			IMultiString descr = cache.LanguageProject.Description;
			var descriptions = new Dictionary<string, string>();
			foreach (int wsid in descr.AvailableWritingSystemIds)
			{
				var descrText = descr.get_String(wsid).Text;
				if ((!string.IsNullOrEmpty(descrText)) && (descrText != "***"))
					descriptions[wsMgr.Get(wsid).GetIso3Code()] = descrText;
			}

			if (descriptions.Count > 0)
				model.SetDescription(descriptions);

			AddMetsPairs(model, viProvider.ShortNumericAppVersion, cache);

			const string localizationMgrId = "Archiving";

			if (s_localizationMgr == null)
			{
				s_localizationMgr = LocalizationManager.Create(
					uiLocale,
					localizationMgrId, viProvider.ProductName, viProvider.NumericAppVersion,
					FwDirectoryFinder.GetCodeSubDirectory("ArchivingLocalizations"),
					Path.Combine(Application.CompanyName, appName),
					localizationDialogIcon, "[email protected]", "SIL.Archiving");
			}
			else
			{
				LocalizationManager.SetUILanguage(uiLocale, true);
			}

			// create the dialog
			using (var dlg = new ArchivingDlg(model, localizationMgrId, dialogFont, new FormSettings()))
			using (var reportingAdapter = new PalasoErrorReportingAdapter(dlg, mediator))
			{
				ErrorReport.SetErrorReporter(reportingAdapter);
				dlg.ShowDialog(owner);
				ErrorReport.SetErrorReporter(null);
			}

			return true;
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:73,代码来源:ReapRamp.cs

示例13: GetWs

		/// <summary>
		/// Look for a simple writing system spec as part of a node...currently either 'analysis' or 'vernacular'.
		/// If not found, answer 0.
		/// If found, answer the ID of the appropriate writing system, or throw exception if not valid.
		/// </summary>
		/// <param name="cache"></param>
		/// <param name="node"></param>
		/// <returns></returns>
		static int GetWs(Mediator mediator, FdoCache cache, XmlNode node)
		{
			string wsSpec = XmlUtils.GetOptionalAttributeValue(node, "ws");
			if (wsSpec != null)
			{
				int ws = 0;
				switch (wsSpec)
				{
					case "vernacular":
						ws = cache.LangProject.DefaultVernacularWritingSystem;
						break;
					case "analysis":
						ws = cache.LangProject.DefaultAnalysisWritingSystem;
						break;
					case "pronunciation":
						ws = cache.LangProject.DefaultPronunciationWritingSystem;
						break;
					case "reversal":
						int rih = int.Parse((string)mediator.PropertyTable.GetValue("ReversalIndexHvo"));
						if (rih > 0)
						{
							IReversalIndex ri = ReversalIndex.CreateFromDBObject(cache, rih);
							ws = ri.WritingSystemRAHvo;
						}
						else
							throw new ApplicationException("Couldn't find current reversal index.");
						break;
					default:
						throw new ApplicationException("ws must be 'vernacular', 'analysis', 'pronunciation',  or 'reversal';" + " it said '" + wsSpec + "'.");
				}
				return ws;
			}
			else
				return 0;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:43,代码来源:SliceFactory.cs

示例14: MakeInflAffixEntryChooserCommand

		public MakeInflAffixEntryChooserCommand(FdoCache cache, bool fCloseBeforeExecuting,
			string sLabel, bool fPrefix, IMoInflAffixSlot slot, Mediator mediator)
			: base(cache, fCloseBeforeExecuting, sLabel, mediator)
		{
			m_fPrefix = fPrefix;
			m_slot = slot;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:7,代码来源:ChooserCommand.cs

示例15: SetDlgInfo

		/// <summary>
		/// Set up the dlg in preparation to showing it.
		/// </summary>
		/// <param name="cache">FDO cache.</param>
		/// <param name="mediator">Mediator used to restore saved siz and location info.</param>
		/// <param name="startingEntry">Entry that cannot be used as a match in this dlg.</param>
		public void SetDlgInfo(FdoCache cache, Mediator mediator, ILexEntry startingEntry)
		{
			CheckDisposed();

			Debug.Assert(startingEntry != null);
			m_startingEntry = startingEntry;

			SetDlgInfo(cache, null, mediator);

			// Relocate remaining three buttons.
			Point pt = m_btnHelp.Location;
			// Make the Help btn 20 off the right edge of the dlg
			pt.X = Width - m_btnHelp.Width - 20;
			m_btnHelp.Location = pt;
			// Make the Cancel btn 10 from the left of the Help btn
			pt.X -= (m_btnClose.Width + 10);
			m_btnClose.Location = pt;
			// Make the Merge Entry btn 10 from the left of the Cancel btn.
			pt.X -= (m_btnOK.Width + 10);
			m_btnOK.Location = pt;
			SetBottomMessage();

			SetHelpTopic("khtpMergeEntry");

			//LT-3017 Launch the dialog with the Lexeme that is currently selected.
			Form = m_startingEntry.HomographForm;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:33,代码来源:MergeEntryDlg.cs


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