本文整理汇总了C#中ICmPossibilityList类的典型用法代码示例。如果您正苦于以下问题:C# ICmPossibilityList类的具体用法?C# ICmPossibilityList怎么用?C# ICmPossibilityList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICmPossibilityList类属于命名空间,在下文中一共展示了ICmPossibilityList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: 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;
}
示例3: MakeAnnDefn
private void MakeAnnDefn(ICmPossibilityList defns, string guid)
{
CmAnnotationDefn defn = new CmAnnotationDefn();
defns.PossibilitiesOS.Append(defn);
Cache.VwCacheDaAccessor.CacheGuidProp(defn.Hvo, (int)CmObjectFields.kflidCmObject_Guid,
new Guid(guid));
}
示例4: CallLoadKeyTerms
/// ------------------------------------------------------------------------------------
/// <summary>
/// Call the base class method
/// </summary>
/// ------------------------------------------------------------------------------------
public static void CallLoadKeyTerms(ICmPossibilityList oldKeyTermsList,
ICmPossibilityList newKeyTermsList, BiblicalTermsList terms,
List<BiblicalTermsLocalization> localizations)
{
IScripture scr = newKeyTermsList.Cache.LangProject.TranslatedScriptureOA;
new DummyTeKeyTermsInit(scr).LoadKeyTerms(null, oldKeyTermsList, newKeyTermsList,
terms, localizations);
}
示例5: PopupTreeManager
/// <summary>
/// Constructor.
/// </summary>
public PopupTreeManager(PopupTree popupTree, FdoCache cache, ICmPossibilityList list, int ws, bool useAbbr, Form parent)
{
m_popupTree = popupTree;
Init(cache, list, ws, useAbbr, parent);
popupTree.BeforeSelect += new TreeViewCancelEventHandler(m_treeCombo_BeforeSelect);
popupTree.AfterSelect += new TreeViewEventHandler(m_treeCombo_AfterSelect);
popupTree.PopupTreeClosed += new TreeViewEventHandler(popupTree_PopupTreeClosed);
}
示例6: PopupTreeManager
/// <summary>
/// Constructor.
/// </summary>
public PopupTreeManager(PopupTree popupTree, FdoCache cache, Mediator mediator, ICmPossibilityList list, int ws, bool useAbbr, Form parent)
{
m_popupTree = popupTree;
Init(cache, mediator, list, ws, useAbbr, parent);
popupTree.BeforeSelect += m_treeCombo_BeforeSelect;
popupTree.AfterSelect += m_treeCombo_AfterSelect;
popupTree.PopupTreeClosed += popupTree_PopupTreeClosed;
}
示例7: ConvertOptionListFromFdo
public ConvertFdoToMongoOptionList ConvertOptionListFromFdo(ILfProject project, string listCode, ICmPossibilityList fdoOptionList, bool updateMongoList = true)
{
LfOptionList lfExistingOptionList = _conn.GetLfOptionListByCode(project, listCode);
var converter = new ConvertFdoToMongoOptionList(lfExistingOptionList, _wsEn, listCode, _env.Logger, _cache.WritingSystemFactory);
LfOptionList lfChangedOptionList = converter.PrepareOptionListUpdate(fdoOptionList);
if (updateMongoList)
_conn.UpdateRecord(project, lfChangedOptionList, listCode);
return new ConvertFdoToMongoOptionList(lfChangedOptionList, _wsEn, listCode, _env.Logger, _cache.WritingSystemFactory);
}
示例8: KeyTermsTree
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="KeyTermsTree"/> class.
/// </summary>
/// ------------------------------------------------------------------------------------
public KeyTermsTree(ICmPossibilityList keyTermsList)
{
BorderStyle = BorderStyle.None;
HideSelection = false;
m_keyTermsList = keyTermsList;
m_cache = m_keyTermsList.Cache;
m_wsDefault = m_cache.DefaultUserWs;
GetFontForWs = (ws => Font); // By default, just use the control's font (from Designer)
}
示例9: Load
/// ------------------------------------------------------------------------------------
/// <summary>
/// Loads the tree with the specified list of possibilities.
/// </summary>
/// ------------------------------------------------------------------------------------
public virtual void Load(ICmPossibilityList list, List<int> initiallySelectedHvos,
Label lblSelectedCategories)
{
m_lblSelectedCategories = lblSelectedCategories;
Nodes.Clear();
m_initiallySelectedHvos = (initiallySelectedHvos ?? new List<int>());
if (list != null)
{
foreach (ICmPossibility possibility in list.PossibilitiesOS)
Nodes.Add(CreateNode(possibility));
}
}
示例10: Load
/// ------------------------------------------------------------------------------------
/// <summary>
/// Loads the tree with the specified list of possibilities.
/// </summary>
/// ------------------------------------------------------------------------------------
public virtual void Load(ICmPossibilityList list, List<int> initiallySelectedHvos,
Label lblSelectedCategories)
{
m_lblSelectedCategories = lblSelectedCategories;
Nodes.Clear();
StringUtils.InitIcuDataDir(); // used for normalizing strings to NFC
m_initiallySelectedHvos = (initiallySelectedHvos ?? new List<int>());
if (list != null)
{
foreach (ICmPossibility possibility in list.PossibilitiesOS)
Nodes.Add(CreateNode(possibility));
}
}
示例11: Init
private void Init(FdoCache cache, ICmPossibilityList list, int ws, bool useAbbr, Form parent)
{
if (m_parent == null)
{
if (SIL.FieldWorks.Common.Framework.FwApp.App != null)
m_parent = SIL.FieldWorks.Common.Framework.FwApp.App.ActiveMainWindow;
if (m_parent == null)
m_parent = Form.ActiveForm; // desperate for something...
}
m_cache = cache;
m_useAbbr = useAbbr;
m_parent = parent;
m_list = list;
m_ws = ws;
}
示例12: CreateCategories
/// ------------------------------------------------------------------------------------
/// <summary>
/// Creates the categories.
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="list">The possibility (category) list.</param>
/// <param name="ws">The writing system for setting the category names.</param>
/// <returns></returns>
/// ------------------------------------------------------------------------------------
internal static ICmPossibilityList CreateCategories(FdoCache cache,
ICmPossibilityList list, int ws)
{
list = cache.LangProject.TranslatedScriptureOA.NoteCategoriesOA;
// Initialize text.
ITsPropsBldr ttpBldr = TsPropsBldrClass.Create();
ttpBldr.SetIntPropValues((int)FwTextPropType.ktptWs,
(int)FwTextPropVar.ktpvDefault, ws);
ITsStrBldr tsStrBldr = TsStrBldrClass.Create();
// Set possibilities on top level--"Level 1a"
CmPossibility possibility1a = new CmPossibility();
list.PossibilitiesOS.Append(possibility1a);
tsStrBldr.ReplaceRgch(0, 0, "Level 1a", 8, ttpBldr.GetTextProps());
possibility1a.Name.SetAlternative(tsStrBldr.GetString(), ws);
// Add another on top level--"Level 1b"
CmPossibility possibility1b = new CmPossibility();
list.PossibilitiesOS.Append(possibility1b);
tsStrBldr.ReplaceRgch(0, tsStrBldr.Length, "Level 1b", 8, ttpBldr.GetTextProps());
possibility1b.Name.SetAlternative(tsStrBldr.GetString(), ws);
// Add possibilities on second level under "Level 1b"--"Level 2a"
CmPossibility subPossibility2a = new CmPossibility();
possibility1b.SubPossibilitiesOS.Append(subPossibility2a);
tsStrBldr.ReplaceRgch(0, tsStrBldr.Length, "Level 2a, parent is 1b", 22, ttpBldr.GetTextProps());
subPossibility2a.Name.SetAlternative(tsStrBldr.GetString(), ws);
// Add "Level 2b" under "Level 1b"
CmPossibility subPossibility2b = new CmPossibility();
possibility1b.SubPossibilitiesOS.Append(subPossibility2b);
tsStrBldr.ReplaceRgch(0, tsStrBldr.Length, "Level 2b, parent is 1b", 22, ttpBldr.GetTextProps());
subPossibility2b.Name.SetAlternative(tsStrBldr.GetString(), ws);
// Add "Level 3" under "Level 2b"
CmPossibility subSubPossibility3 = new CmPossibility();
subPossibility2b.SubPossibilitiesOS.Append(subSubPossibility3);
tsStrBldr.ReplaceRgch(0, tsStrBldr.Length, "Level 3, parent is 2b", 21, ttpBldr.GetTextProps());
subSubPossibility3.Name.SetAlternative(tsStrBldr.GetString(), ws);
return list;
}
示例13: Init
private void Init(FdoCache cache, Mediator mediator, ICmPossibilityList list, int ws, bool useAbbr, Form parent)
{
m_mediator = mediator;
if (parent == null)
{
if (mediator != null)
{
IApp app = (IApp)mediator.PropertyTable.GetValue("App");
if (app != null)
parent = app.ActiveMainWindow;
}
if (parent == null)
parent = Form.ActiveForm; // desperate for something...
}
m_cache = cache;
m_useAbbr = useAbbr;
m_parent = parent;
m_list = list;
m_ws = ws;
}
示例14: CreateTestData
/// ------------------------------------------------------------------------------------
/// <summary>
/// create test data
/// </summary>
/// ------------------------------------------------------------------------------------
protected override void CreateTestData()
{
base.CreateTestData();
m_xmlNote = new XmlNoteCategory();
// Initialize the annotation category possibility list.
m_possList = CreateCategories(Cache, m_wsSpanish);
}
示例15: CreateKnownPossibilityList
private void CreateKnownPossibilityList()
{
// this list exists empty in the FdoTestBase.
m_testList = Cache.LangProject.ConfidenceLevelsOA;
Assert.AreEqual(0, m_testList.PossibilitiesOS.Count);
Assert.AreEqual("Possibilities", Cache.MetaDataCache.GetFieldName(possibilitiesFlid));
AppendTestItemToList("First"); // So tests automatically have one item.
}