本文整理汇总了C#中ICmPossibilityList类的典型用法代码示例。如果您正苦于以下问题:C# ICmPossibilityList类的具体用法?C# ICmPossibilityList怎么用?C# ICmPossibilityList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICmPossibilityList类属于命名空间,在下文中一共展示了ICmPossibilityList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:10,代码来源:MSAPopupTreeManager.cs
示例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;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:28,代码来源:PossibilityAutoComplete.cs
示例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));
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:7,代码来源:InMemoryDiscourseTestBase.cs
示例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);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:13,代码来源:TeKeyTermsInitTests.cs
示例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);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:11,代码来源:PopupTreeManager.cs
示例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;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:11,代码来源:PopupTreeManager.cs
示例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);
}
开发者ID:ermshiperete,项目名称:LfMerge,代码行数:9,代码来源:FdoTestBase.cs
示例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)
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:15,代码来源:KeyTermsTree.cs
示例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));
}
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:19,代码来源:ChooserTreeView.cs
示例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));
}
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:20,代码来源:ChooserTreeView.cs
示例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;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:16,代码来源:PopupTreeManager.cs
示例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;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:52,代码来源:XmlNoteCategoryTests.cs
示例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;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:21,代码来源:PopupTreeManager.cs
示例14: Run
/// ----------------------------------------------------------------------------------------
/// <summary>
/// Main entry point for deleting Custom Lists.
/// Needs to:
/// 1 - Make sure the given list really is a Custom List
/// 2 - Let the user know if any of the possibilities of this list are being referenced.
/// 3 - Delete the list (and its possibilities and subpossibilities) and, consequently,
/// any references to those possibilities.
/// </summary>
/// ----------------------------------------------------------------------------------------
public void Run(ICmPossibilityList curList)
{
m_listToDelete = curList;
// Make sure list is a CUSTOM list!
var owner = m_listToDelete.Owner; // Custom lists are unowned!
if (owner != null)
return; // Not a Custom list!
// Make sure user knows if any possibilities owned by this list are referenced
// by anything else!
GetCustomFieldsReferencingList(m_listToDelete.Guid);
ICmPossibility poss;
if (HasPossibilityReferences(out poss) > 0)
{
var name = poss.Name.BestAnalysisVernacularAlternative.Text;
// Warn user that possibilities in this list are in use.
if (CheckWithUser(name) != DialogResult.Yes)
return;
}
DeleteList(m_listToDelete);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:32,代码来源:DeleteCustomList.cs
示例15: MakeContextMenu_AvailableTags
protected void MakeContextMenu_AvailableTags(ContextMenuStrip menu, ICmPossibilityList list)
{
foreach (ICmPossibility tagList in list.PossibilitiesOS)
{
if (tagList.SubPossibilitiesOS.Count > 0)
AddListToMenu(menu, tagList);
}
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:8,代码来源:InterlinTaggingChild.cs
示例16: LoadPossibilitiesFromXml
private void LoadPossibilitiesFromXml(XmlReader xrdr, ICmPossibilityList owner, string sItemClassName)
{
if (xrdr.ReadToDescendant(sItemClassName))
{
EnsureFactoryForClass(sItemClassName);
do
{
string sGuid = xrdr.GetAttribute("guid");
xrdr.MoveToElement();
Guid guid = Guid.Empty;
if (!String.IsNullOrEmpty(sGuid))
guid = new Guid(sGuid);
ICmPossibility poss = null;
switch (sItemClassName)
{
case "CmPossibility":
poss = m_factPoss.Create(EnsureGuid(guid), owner);
break;
case "CmAnthroItem":
poss = m_factAnthro.Create(EnsureGuid(guid), owner) as ICmPossibility;
break;
case "CmSemanticDomain":
poss = m_factSemDom.Create(EnsureGuid(guid), owner) as ICmPossibility;
break;
case "PartOfSpeech":
Debug.Assert(guid != Guid.Empty);
poss = m_factPOS.Create(guid, owner);
break;
default:
// TODO: implement other subclasses of CmPossibility?
break;
}
Debug.Assert(poss != null);
ReadPossItem(xrdr.ReadSubtree(), poss, sItemClassName);
} while (xrdr.ReadToNextSibling(sItemClassName));
}
xrdr.Read(); // reads end element.
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:38,代码来源:XmlList.cs
示例17: FwChooserDlg
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="FwChooserDlg"/> class.
/// </summary>
/// <param name="list">The possibility list used to populate the tree</param>
/// <param name="initiallySelectedHvos">The sequence of HVOs of initially selected
/// possibilities</param>
/// <param name="helptopicProvider">object that knows how to serve up help topics</param>
/// <param name="sHelpTopicKey">Topic to display if user clicks Help button (can be
/// specific to the possibility list being displayed)</param>
/// <param name="projSettingsKey">The project settings key.</param>
/// ------------------------------------------------------------------------------------
public FwChooserDlg(ICmPossibilityList list, int[] initiallySelectedHvos,
IHelpTopicProvider helptopicProvider, string sHelpTopicKey,
IProjectSpecificSettingsKeyProvider projSettingsKey) : this()
{
if (initiallySelectedHvos == null)
throw new ArgumentNullException("initiallySelectedHvos");
if (list == null)
throw new ArgumentNullException("list");
m_list = list;
m_cache = m_list.Cache;
m_initiallySelectedHvos = new List<int>(initiallySelectedHvos);
m_helptopicProvider = helptopicProvider;
m_helpTopicKey = sHelpTopicKey;
m_projSettingsKey = projSettingsKey;
SetTitle();
tvPossibilities.Load(m_list, m_initiallySelectedHvos, SelectedPossibilitiesLabel);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:30,代码来源:FwChooserDlg.cs
示例18: GetPossibility
/// ------------------------------------------------------------------------------------
/// <summary>
/// Shows the Chooser dialog to allow the user to select a single possibility.
/// </summary>
/// <remarks>Used for filtering</remarks>
/// <param name="list">The possibility list used to populate the tree</param>
/// <param name="initialSelected">The possibility to check initially, or null to
/// show with no initial selection</param>
/// <returns>A single chosen CmPossibility, or null if user cancels or chooses
/// nothing.</returns>
/// ------------------------------------------------------------------------------------
public ICmPossibility GetPossibility(ICmPossibilityList list, ICmPossibility initialSelected)
{
//CheckDisposed();
//m_initiallySelectedHvos = new List<int>(1);
//m_initiallySelectedHvos.Add(hvoPoss);
//if (list != (CmPossibilityList)m_list)
//{
// m_list = list;
// SetTitle();
//}
//tvPossibilities.Load(m_list, m_initiallySelectedHvos);
//if (ShowDialog() != DialogResult.OK)
// return 0;
//List<int> newHvos = tvPossibilities.SelectedHvos;
//return (newHvos != null && newHvos.Count > 0 ? newHvos[0] : 0);
// REVIEW: Currently, the chooser tree doesn't allow the user to select
// only one possibility. If this method and single node selection is ever
// necessary, then this method will need to be rewritten.
return null;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:36,代码来源:FwChooserDlg.cs
示例19: RequiresDialogChooser
/// <summary>
/// Return true if the specified list requires us to use a chooser dialog rather than putting a simple combo box
/// in the bulk edit bar. Currently we do this if the list is (actually, not just potentially) hierarchical,
/// or if it has more than 25 items.
/// Note that at least one unit test will break if this method causes the default Locations list to be treated
/// as hierarchical.
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
private bool RequiresDialogChooser(ICmPossibilityList list)
{
if (list.PossibilitiesOS.Count > 25)
return true;
foreach (var item in list.PossibilitiesOS)
{
if (item.SubPossibilitiesOS.Count > 0)
return true;
}
return false;
}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:20,代码来源:BulkEditBar.cs
示例20: MasterCategoryListChooserLauncher
public MasterCategoryListChooserLauncher(Form popupMgrParent, Mediator mediator,
ICmPossibilityList possibilityList, string fieldName, ILexSense sense)
{
m_parentOfPopupMgr = popupMgrParent;
m_mediator = mediator;
CategoryList = possibilityList;
m_sense = sense;
FieldName = fieldName;
Cache = m_sense.Cache;
Application.Idle += new EventHandler(LaunchChooseFromMasterCategoryListOnIdle);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:12,代码来源:MSAPopupTreeManager.cs
注:本文中的ICmPossibilityList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论