本文整理汇总了C#中XCore.List类的典型用法代码示例。如果您正苦于以下问题:C# List类的具体用法?C# List怎么用?C# List使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
List类属于XCore命名空间,在下文中一共展示了List类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadDataFromInventory
/// <summary>
/// Get protected and user-stored dictionary configurations to load into the dialog.
/// Tests will override this to load the manager in their own fashion.
/// </summary>
private void LoadDataFromInventory(XmlNode current)
{
// Tuples are <uniqueCode, dispName, IsProtected>
var configList = new List<Tuple<string, string, bool>>();
// put them in configList and feed them into the Manager's dictionary.
foreach (var xnView in m_originalViewConfigNodes)
{
var sLabel = XmlUtils.GetManditoryAttributeValue(xnView, "label");
var sLayout = XmlUtils.GetManditoryAttributeValue(xnView, "layout");
var fProtected = !sLayout.Contains(Inventory.kcMarkLayoutCopy);
configList.Add(new Tuple<string, string, bool>(sLayout, sLabel, fProtected));
}
LoadInternalDictionary(configList);
var sLayoutCurrent = XmlUtils.GetManditoryAttributeValue(current, "layout");
m_originalView = sLayoutCurrent;
m_currentView = m_originalView;
if (m_configList.Count == 0)
return;
// Now set up the actual dialog's contents
RefreshView();
}
示例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: 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();
}
示例4: MakeMenuItems
protected override TreeNode MakeMenuItems(PopupTree popupTree, int hvoTarget)
{
int tagNamePOS = UseAbbr ?
CmPossibilityTags.kflidAbbreviation :
CmPossibilityTags.kflidName;
List<HvoTreeNode> relevantPartsOfSpeech = new List<HvoTreeNode>();
GatherPartsOfSpeech(Cache, List.Hvo, CmPossibilityListTags.kflidPossibilities,
CmPossibilityTags.kflidSubPossibilities,
PartOfSpeechTags.kflidInflectionClasses,
tagNamePOS, WritingSystem,
relevantPartsOfSpeech);
relevantPartsOfSpeech.Sort();
int tagNameClass = UseAbbr ?
MoInflClassTags.kflidAbbreviation :
MoInflClassTags.kflidName;
TreeNode match = null;
foreach(HvoTreeNode item in relevantPartsOfSpeech)
{
popupTree.Nodes.Add(item);
TreeNode match1 = AddNodes(item.Nodes, item.Hvo,
PartOfSpeechTags.kflidInflectionClasses,
MoInflClassTags.kflidSubclasses,
hvoTarget, tagNameClass);
if (match1 != null)
match = match1;
}
return match;
}
示例5: MakeMenuItems
protected override TreeNode MakeMenuItems(PopupTree popupTree, int hvoTarget)
{
int tagNamePOS = UseAbbr ?
(int)CmPossibility.CmPossibilityTags.kflidAbbreviation :
(int)CmPossibility.CmPossibilityTags.kflidName;
List<HvoTreeNode> relevantPartsOfSpeech = new List<HvoTreeNode>();
InflectionClassPopupTreeManager.GatherPartsOfSpeech(Cache, List.Hvo,
(int)CmPossibilityList.CmPossibilityListTags.kflidPossibilities,
(int)CmPossibility.CmPossibilityTags.kflidSubPossibilities,
(int)PartOfSpeech.PartOfSpeechTags.kflidInflectableFeats,
tagNamePOS, WritingSystem,
relevantPartsOfSpeech);
relevantPartsOfSpeech.Sort();
TreeNode match = null;
foreach(HvoTreeNode item in relevantPartsOfSpeech)
{
popupTree.Nodes.Add(item);
IPartOfSpeech pos = (IPartOfSpeech)PartOfSpeech.CreateFromDBObject(Cache, item.Hvo, false);
foreach(IFsFeatStruc fs in pos.ReferenceFormsOC)
{
// Note: beware of using fs.ShortName. That can be
// absolutely EMPTY (if the user has turned off the 'Show Abbreviation as its label'
// field for both the feature category and value).
// ChooserName shows the short name if it is non-empty, otherwise the long name.
HvoTreeNode node = new HvoTreeNode(fs.ChooserNameTS, fs.Hvo);
item.Nodes.Add(node);
if (fs.Hvo == hvoTarget)
match = node;
}
item.Nodes.Add(new HvoTreeNode(Cache.MakeUserTss(LexTextControls.ksChooseInflFeats), kMore));
}
return match;
}
示例6: FixedOrphanFootnoteReportDlg
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="T:FixedOrphanFootnoteReportDlg"/> class.
/// </summary>
/// <param name="issues">List of styles that the user has modified.</param>
/// <param name="projectName">Name of the project.</param>
/// <param name="helpTopicProvider">context sensitive help</param>
/// ------------------------------------------------------------------------------------
public FixedOrphanFootnoteReportDlg(List<string> issues, string projectName,
IHelpTopicProvider helpTopicProvider) :
base(issues, projectName, helpTopicProvider)
{
InitializeComponent();
RepeatTitleOnEveryPage = true;
RepeatColumnHeaderOnEveryPage = false;
}
示例7: PopulateCtrlTabTargetCandidateList
public Control PopulateCtrlTabTargetCandidateList(List<Control> targetCandidates)
{
CheckDisposed();
if (targetCandidates == null)
throw new ArgumentNullException("targetCandidates");
targetCandidates.Add(this);
return ContainsFocus ? this : null;
}
示例8: GetMessageTargets
/// <summary>
/// return an array of all of the objects which should
/// 1) be queried when looking for someone to deliver a message to
/// 2) be potential recipients of a broadcast
/// </summary>
/// <returns></returns>
public IxCoreColleague[] GetMessageTargets()
{
List<IxCoreColleague> colleagues = new List<IxCoreColleague>();
colleagues.Add(this);
// Add current FindComboFiller & UsedByFiller.
// Those
return colleagues.ToArray();
}
示例9: PopulateCtrlTabTargetCandidateList
public Control PopulateCtrlTabTargetCandidateList(List<Control> targetCandidates)
{
if (targetCandidates == null)
throw new ArgumentNullException("'targetCandidates' is null.");
targetCandidates.Add(this);
return ContainsFocus ? this : null;
}
示例10: DictionaryConfigManager
/// <summary>
/// Create the Manager for stored dictionary configurations.
/// </summary>
public DictionaryConfigManager(IDictConfigViewer viewer, List<XmlNode> configViews,
XmlNode current)
{
m_viewer = viewer;
m_originalViewConfigNodes = configViews;
m_configList = new Dictionary<string, DictConfigItem>();
m_fPersisted = false;
LoadDataFromInventory(current);
}
示例11: TePageSetupDlg
// private decimal m_standardLeadingFactor;
#endregion
#region Constructor
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="T:TePageSetupDlg"/> class.
/// </summary>
/// <param name="pgLayout">The page layout.</param>
/// <param name="scr">The Scripture object (which owns the publications).</param>
/// <param name="publication">The publication.</param>
/// <param name="division">The division. The NumberOfColumns in the division should be
/// set before calling this dialog.</param>
/// <param name="teMainWnd">TE main window (provides callbacks).</param>
/// <param name="helpTopicProvider">The help topic provider.</param>
/// <param name="app">The app.</param>
/// <param name="fIsTrialPub">if set to <c>true</c> view from which this dialog
/// was brought up is Trial Publication view.</param>
/// <param name="pubPageSizes">The page sizes available for publication.</param>
/// ------------------------------------------------------------------------------------
public TePageSetupDlg(IPubPageLayout pgLayout, IScripture scr,
IPublication publication, IPubDivision division, IPageSetupCallbacks teMainWnd,
IHelpTopicProvider helpTopicProvider, IApp app, bool fIsTrialPub,
List<PubPageInfo> pubPageSizes) :
base(pgLayout, scr, publication, division, teMainWnd, helpTopicProvider,
app, pubPageSizes)
{
m_fIsTrialPublication = fIsTrialPub;
// if (!m_chkNonStdChoices.Checked) // following the standard
// m_standardLeadingFactor = m_nudLineSpacing.Value / m_nudBaseCharSize.Value;
}
示例12: InterestingTextList
public InterestingTextList(PropertyTable propertyTable, ITextRepository repo,
IStTextRepository stTextRepo, bool includeScripture)
{
m_textRepository = repo;
m_propertyTable = propertyTable;
m_stTextRepository = stTextRepo;
CoreTexts = GetCoreTexts();
m_scriptureTexts = GetScriptureTexts();
IncludeScripture = includeScripture;
GetCache();
}
示例13: SummaryDialogForm
private bool m_fOtherClicked; // set true by btnOther_Click, caller should call OtherButtonClicked after dialog closes.
#endregion
#region Constructor/destructor
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructor for a single LexEntry object.
/// </summary>
/// <param name="leui">The lex entry ui.</param>
/// <param name="tssForm">The TSS form.</param>
/// <param name="helpProvider">The help provider.</param>
/// <param name="helpFileKey">string key to get the help file name</param>
/// <param name="styleSheet">The stylesheet.</param>
/// ------------------------------------------------------------------------------------
internal SummaryDialogForm(LexEntryUi leui, ITsString tssForm, IHelpTopicProvider helpProvider,
string helpFileKey, IVwStylesheet styleSheet)
{
InitializeComponent();
AccessibleName = GetType().Name;
m_rghvo = new List<int>(1);
m_rghvo.Add(leui.Object.Hvo);
m_cache = leui.Object.Cache;
m_mediator = leui.Mediator;
Initialize(tssForm, helpProvider, helpFileKey, styleSheet);
}
示例14: FwUpdateReportDlg
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructor for FwUpdateReportDlg
/// </summary>
/// <param name="itemsToReport">List of items to report in the list.</param>
/// <param name="projectName">Name of the project.</param>
/// <param name="helpTopicProvider">context sensitive help</param>
/// ------------------------------------------------------------------------------------
public FwUpdateReportDlg(List<string> itemsToReport, string projectName,
IHelpTopicProvider helpTopicProvider) : this()
{
lblProjectName.Text = String.Format(lblProjectName.Text, projectName);
m_helpTopicProvider = helpTopicProvider;
// show list of names
foreach (string item in itemsToReport)
lvItems.Items.Add(item);
TopMost = true;
}
示例15: 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 = TsStrFactoryClass.Create();
m_fwTextBoxBottomMsg.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor;
m_fwTextBoxBottomMsg.WritingSystemCode = m_cache.LangProject.DefaultUserWritingSystem;
InitBrowseView(guiControl, mergeCandidates);
// Get location to the stored values, if any.
object locWnd = m_mediator.PropertyTable.GetValue("mergeDlgLocation");
// JohnT: this dialog can't be resized. So it doesn't make sense to
// remember a size. If we do, we need to override OnLoad (as in SimpleListChooser)
// to prevent the dialog growing every time at 120 dpi. But such an override
// makes it too small to show all the controls at the default size.
// It's better just to use the default size until it's resizeable for some reason.
//m_mediator.PropertyTable.GetValue("msaCreatorDlgSize");
// And when I do this, it works the first time, but later times the window is
// too small and doesn't show all the controls. Give up on smart location for now.
//object szWnd = this.Size;
object szWnd = null; // suppresses the smart location stuff.
if (locWnd != null && szWnd != null)
{
Rectangle rect = new Rectangle((Point)locWnd, (Size)szWnd);
ScreenUtils.EnsureVisibleRect(ref rect);
DesktopBounds = rect;
StartPosition = FormStartPosition.Manual;
}
Text = wp.m_title;
label2.Text = wp.m_label;
m_helpTopic = helpTopic;
if(m_helpTopic != null && FwApp.App != null) // FwApp.App could be null for testing
{
helpProvider = new System.Windows.Forms.HelpProvider();
helpProvider.HelpNamespace = FwApp.App.HelpFile;
helpProvider.SetHelpKeyword(this, FwApp.App.GetHelpString(m_helpTopic, 0));
helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);
}
}