本文整理汇总了C#中System.Windows.Documents.List.Select方法的典型用法代码示例。如果您正苦于以下问题:C# List.Select方法的具体用法?C# List.Select怎么用?C# List.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Documents.List
的用法示例。
在下文中一共展示了List.Select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static FrameworkElement Create(IClassificationFormatMap classificationFormatMap, string text, List<TextClassificationTag> tagsList, TextElementFlags flags) {
bool useFastTextBlock = (flags & (TextElementFlags.TrimmingMask | TextElementFlags.WrapMask | TextElementFlags.FilterOutNewLines)) == (TextElementFlags.NoTrimming | TextElementFlags.NoWrap | TextElementFlags.FilterOutNewLines);
bool filterOutNewLines = (flags & TextElementFlags.FilterOutNewLines) != 0;
if (tagsList.Count != 0) {
if (useFastTextBlock) {
return new FastTextBlock((flags & TextElementFlags.NewFormatter) != 0, new TextSrc {
text = ToString(text, filterOutNewLines),
classificationFormatMap = classificationFormatMap,
tagsList = tagsList.ToArray(),
});
}
var propsSpans = tagsList.Select(a => new TextRunPropertiesAndSpan(a.Span, classificationFormatMap.GetTextProperties(a.ClassificationType)));
var textBlock = TextBlockFactory.Create(text, classificationFormatMap.DefaultTextProperties, propsSpans, TextBlockFactory.Flags.DisableSetTextBlockFontFamily | TextBlockFactory.Flags.DisableFontSize | (filterOutNewLines ? TextBlockFactory.Flags.FilterOutNewlines : 0));
textBlock.TextTrimming = GetTextTrimming(flags);
textBlock.TextWrapping = GetTextWrapping(flags);
return textBlock;
}
FrameworkElement fwElem;
if (useFastTextBlock) {
fwElem = new FastTextBlock((flags & TextElementFlags.NewFormatter) != 0) {
Text = ToString(text, filterOutNewLines)
};
}
else {
fwElem = new TextBlock {
Text = ToString(text, filterOutNewLines),
TextTrimming = GetTextTrimming(flags),
TextWrapping = GetTextWrapping(flags),
};
}
return InitializeDefault(classificationFormatMap, fwElem);
}
示例2: PlayerSelector
public PlayerSelector(List<Player> players)
{
InitializeComponent();
Players = players;
CB_PlayerSelector.ItemsSource = Players.Select(p => p.Name).ToList();
}
示例3: OnTodoListStoreChanged
private void OnTodoListStoreChanged(List<TodoItem> todoItems)
{
// Remove items that didn't come from the list
var itemsToRemove = m_todoMainContext.TodoItems.Where(i => !todoItems.Select(ti => ti.Id).Contains(i.Id)).ToList();
foreach (var itemToRemove in itemsToRemove)
{
m_todoMainContext.TodoItems.Remove(itemToRemove);
}
// Add or modify all others
foreach (var todoItem in todoItems)
{
var todoItemControl = m_todoMainContext.TodoItems.FirstOrDefault(i => i.Id == todoItem.Id);
if (todoItemControl == null)
{
m_todoMainContext.TodoItems.Add(new TodoItemControl
{
Id = todoItem.Id,
Label = todoItem.Label,
IsCompleted = todoItem.IsCompleted
});
}
else
{
todoItemControl.Label = todoItem.Label;
todoItemControl.IsCompleted = todoItem.IsCompleted;
}
}
}
示例4: ShowDialog
public bool ShowDialog()
{
var fileWorker = NetDocumentsModule.Instance.Container.Resolve<IFileSystemWorker>();
var app = new NdMultiDocumentApplication();
var eventsSource = InjectionContainer.Current.Resolve<IEventStream>();
_formats = FileFormat.Parse(Filters);
app.SupportedFileTypesForSave = Convert();
app.DefaultSaveFormat = app.SupportedFileTypesForSave.Skip(plFormatIndex - 1).FirstOrDefault();
app.SupportedFileTypesForOpen = string.Join(",", _formats.Select(a => a.GetExtensionsAsString()));
using (eventsSource.Of<DocumentSavedMessage>().SubscribeSafe(OnSaved, InjectionContainer.Current.Resolve<IExceptionLogger>()))
{
var helper = InjectionContainer.Current.Resolve<NdDialogHelper>(new DependencyOverride(typeof(IMultiDocumentApplication), app));
var withProperName = fileWorker.CreateTempFile(FileName);
try
{
var doc = new Document(withProperName)
{
IsNew = string.IsNullOrEmpty(FileName)// one way to fill initial name to reuse the filename
};
var res = helper.Save(doc, true);
if (res == SaveResult.Saved)
{
return true;
}
return false;
}
finally
{
fileWorker.SafeDeletefile(withProperName);
}
}
}
示例5: GetPolygon
private Polygon GetPolygon(List<Vector2> points, KggCanvas.Color color = null)
{
return new Polygon(points
.Select(x => new Vector2Ext(kggCanvas.Width / 2 + x.X * size, kggCanvas.Height / 2 - x.Y * size) )
.ToList()
,color);
}
示例6: ReadWebRequestCallback
// STEP4 STEP4 STEP4
private string ReadWebRequestCallback(IAsyncResult callbackResult)
{
try
{
HttpWebRequest myRequest = (HttpWebRequest)callbackResult.AsyncState;
HttpWebResponse myResponse = (HttpWebResponse)myRequest.EndGetResponse(callbackResult);
using (StreamReader httpwebStreamReader = new StreamReader(myResponse.GetResponseStream()))
{
string fil = httpwebStreamReader.ReadToEnd();
FileToSave = fil;
if (FileToSave != "")
{
FileManip f = new FileManip();
XML x = new XML();
list = x.Retrive(fil);
if (list.Select(e=>e.Pubdate).Contains(LatestDate))
{
}
f.Update(Filename, FileToSave);
}
}
myResponse.Close();
}
catch (Exception we)
{
}
}
示例7: BtnNodefileSel_OnClick
/// <summary>
/// Get the nodes from the selected text file
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnNodefileSel_OnClick(object sender, RoutedEventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";
//openFileDialog.InitialDirectory = citiesIn.filepath;
if (openFileDialog.ShowDialog() == true)
{
txtboxNodefile.Text = @"...\" + openFileDialog.SafeFileName;
citiesIn.filepath = openFileDialog.FileName;
}
// set the value of the combobox
nodelist = citiesIn.GetCitieses();
maxNumofCities = nodelist.Count;
List<string> citynames = nodelist.Select(cityNode => cityNode.city).ToList();
comboboxStartCity.ItemsSource = citynames;
comboboxStartCity.SelectedIndex = 0;
lboxManualSelectNodes.ItemsSource = citynames;
if (RandomNodeSelect.IsChecked == true)
lboxManualSelectNodes.IsEnabled = false;
else
lboxManualSelectNodes.IsEnabled = true;
// draw the circles
_drawlines(citylisttodraw);
}
示例8: AddSeries
public void AddSeries(ColumnSeries b, List<double> xAxis)
{
var ca = new CategoryAxis() { LabelField = "label",
Labels = (IList<string>)xAxis.Select(i => i.ToString()).ToList() };
plot.Axes.Add(ca);
plot.Series.Add(b);
this.Root.Model = plot;
}
示例9: MainWindow
public MainWindow()
{
InitializeComponent();
this.Loaded += MainWindow_Loaded;
trackInfos = ReadTrackInfos();
var plateBarcodes = trackInfos.Select(x => x.plateBarcode).Distinct().ToList();
lstPlateBarcodes.ItemsSource = plateBarcodes;
}
示例10: ImportStarted
public void ImportStarted(string message, List<XMLImportProgressItem> items)
{
lvw.InvokeIfRequired(() => {
lvw.ItemsSource = new ObservableCollection<ProgressItemViewModel>(items.Select((m) => {
return new ProgressItemViewModel(m);
}));
});
}
示例11: UsersWindows
public UsersWindows()
{
InitializeComponent();
user = new User();
users = user.GetAll();
userGrid.ItemsSource = users.Select(x => x.nombre).ToList() ;
}
示例12: GenerateItemByFilter
public void GenerateItemByFilter(Action<IEnumerable<InvoiceItemDto>, Exception> action, List<long> orderIdList)
{
var url = string.Format(invoiceItemAddressFormatString, 0, string.Empty);
var sb = new StringBuilder(url);
var strOrderLIst = "";
orderIdList.Select(c => strOrderLIst = strOrderLIst + c + ",").ToList();
sb.Append(string.Concat("?orderIdList=", strOrderLIst.Remove(strOrderLIst.Length - 1)));
WebClientHelper.Get(new Uri(sb.ToString(), UriKind.Absolute), action, WebClientHelper.MessageFormat.Json,ApiConfig.Headers);
}
示例13: ContextMenu_Opened
private void ContextMenu_Opened(object sender, RoutedEventArgs e)
{
contextMenu.Items.Clear();
var me = new MenuItem();
var items = new List<KeyValuePair<int, string>>();
foreach (var item in Items)
items.Add((KeyValuePair<int, string>)item);
AddMenuItems(contextMenu, items.Select(x => Tuple.Create(x, x.Value.Split('/'))).ToArray());
}
示例14: dispatch_categories
public void dispatch_categories(List<string> CategoryList)
{
Category_Listbox.Dispatcher.Invoke(
(Action)(() => { Category_Listbox.ItemsSource = CategoryList.Select(i=>i); })
);
Categories_Listbox.Dispatcher.Invoke(
(Action)(() => { Categories_Listbox.ItemsSource = CategoryList.Select(i => i); })
);
category_list.Dispatcher.Invoke((Action)(() => { category_list.ItemsSource = CategoryList.Select(i => i); }));
}
示例15: CleanMotionButton_Click
private void CleanMotionButton_Click(object sender, RoutedEventArgs e)
{
string bodyData = @"C:\Users\non\Desktop\Data\1222\L1\Student1SelectedUserBody.dump";
string timeData = @"C:\Users\non\Desktop\Data\1222\L1\Student1TimeData.dump";
List<string> statData = new List<string>()
{
@"C:\Users\non\Desktop\Data\1222\L1\L1StudentStatData.dump",
};
List<Dictionary<JointType, CvPoint3D64f>> jointsSeq = Utility.ConvertToCvPoint((List<Dictionary<int, float[]>>)Utility.LoadFromBinary(bodyData));
List<DateTime> timeSeq = (List<DateTime>)Utility.LoadFromBinary(timeData);
List<Dictionary<Bone, BoneStatistics>> boneStats = statData.Select(s => (Dictionary<Bone, BoneStatistics>)Utility.LoadFromBinary(s)).ToList();
MotionMetaData mmd = new MotionMetaData(jointsSeq, timeSeq, boneStats);
}