当前位置: 首页>>代码示例>>C#>>正文


C# List.Select方法代码示例

本文整理汇总了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);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:34,代码来源:TextElementFactory.cs

示例2: PlayerSelector

        public PlayerSelector(List<Player> players)
        {
            InitializeComponent();

            Players = players;
            CB_PlayerSelector.ItemsSource = Players.Select(p => p.Name).ToList();
        }
开发者ID:axis7818,项目名称:Sm4shTourney,代码行数:7,代码来源:PlayerSelector.xaml.cs

示例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;
                }
            }
        }
开发者ID:nyccyn,项目名称:Reflux.NET,代码行数:29,代码来源:TodoMain.xaml.cs

示例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);
                }
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:33,代码来源:NdSaveDialog.cs

示例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);
 }
开发者ID:Anovi-Soft,项目名称:KGG,代码行数:7,代码来源:MainWindow.xaml.cs

示例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)
            {

            }
        }
开发者ID:jsandip57,项目名称:PinUrRss,代码行数:30,代码来源:GetData.cs

示例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);
        }
开发者ID:KSWestfall,项目名称:csharp-traveling-salesman,代码行数:32,代码来源:MainWindow.xaml.cs

示例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;
 }
开发者ID:Amichai,项目名称:MySimulations,代码行数:8,代码来源:Chart.xaml.cs

示例9: MainWindow

 public MainWindow()
 {
     InitializeComponent();
     this.Loaded += MainWindow_Loaded;
     trackInfos = ReadTrackInfos();
     var plateBarcodes = trackInfos.Select(x => x.plateBarcode).Distinct().ToList();
     lstPlateBarcodes.ItemsSource = plateBarcodes;
 }
开发者ID:kingofcrabs,项目名称:Biobanking,代码行数:8,代码来源:MainWindow.xaml.cs

示例10: ImportStarted

 public void ImportStarted(string message, List<XMLImportProgressItem> items)
 {
     lvw.InvokeIfRequired(() => {
         lvw.ItemsSource = new ObservableCollection<ProgressItemViewModel>(items.Select((m) => {
             return new ProgressItemViewModel(m);
         }));
     });
 }
开发者ID:kehh,项目名称:biolink,代码行数:8,代码来源:XMLIOImportOptions.xaml.cs

示例11: UsersWindows

        public UsersWindows()
        {
            InitializeComponent();

            user = new User();

            users = user.GetAll();
            userGrid.ItemsSource = users.Select(x => x.nombre).ToList() ;
        }
开发者ID:Maldercito,项目名称:adat,代码行数:9,代码来源:1453377175$UsersWindow.xaml.cs

示例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);
 }
开发者ID:hatefi-arman,项目名称:Modules,代码行数:9,代码来源:InvoiceServiceWrapper_InvoiceItemRelated.cs

示例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());
        }
开发者ID:ValdemarOrn,项目名称:Polyhedrus,代码行数:11,代码来源:MenuSelector.xaml.cs

示例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); }));
        }
开发者ID:KavishPahade,项目名称:Document_Vault,代码行数:12,代码来源:MainWindow.xaml.cs

示例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);
 }
开发者ID:guozanhua,项目名称:KinectMotionCapture,代码行数:13,代码来源:MainWindow.xaml.cs


注:本文中的System.Windows.Documents.List.Select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。