當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。