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


C# SortedSet.Union方法代码示例

本文整理汇总了C#中SortedSet.Union方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.Union方法的具体用法?C# SortedSet.Union怎么用?C# SortedSet.Union使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SortedSet的用法示例。


在下文中一共展示了SortedSet.Union方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CodeContext

 internal CodeContext(
     string name,
     IEnumerable<string> tags,
     string authors = null,
     string source = null,
     string syntax = null,
     string description = null,
     string prerequisites = null,
     CodeContext parentContext = null)
 {
     if (string.IsNullOrWhiteSpace(name))
         throw new ArgumentException("name");
     if (tags == null)
         throw new ArgumentException("tags");
     Name = name;
     Authors = authors ?? (parentContext != null ? parentContext.Authors : string.Empty);
     Source = source ?? (parentContext != null ? parentContext.Source : string.Empty);
     Syntax = syntax ?? (parentContext != null ? parentContext.Syntax : string.Empty);
     SpecificTags = new SortedSet<string>(tags);
     Description = description ?? string.Empty;
     Prerequisites = prerequisites ?? string.Empty;
     ParentContext = parentContext;
     AllTags = parentContext != null
                   ? new SortedSet<string>(SpecificTags.Union(parentContext.AllTags))
                   : new SortedSet<string>(SpecificTags);
 }
开发者ID:CrowdKnowledge,项目名称:codetag,代码行数:26,代码来源:CodeContext.cs

示例2: Main

 static void Main()
 {
     var s1 = new Set<int>();
     s1.Added += (sender, args) => Console.WriteLine("Добавлено: " + args);
     s1.Add(8,2,9);
     var ss1 = new SortedSet<int>(2, 5, 7, 4);
     Console.WriteLine("The first SortedSet: " + ss1);
     Console.WriteLine("Приведённое:" + (Set<int>)ss1);
     var ss2 = new SortedSet<int>(2, 9, 7, 4);
     Console.WriteLine("The second SortedSet: " + ss2);
     Console.WriteLine("Intersection: " + ss1.Intersect(ss2));
     Console.WriteLine("Union: " + ss1.Union(ss2));
     Console.WriteLine("Is the first SortedSet contain " + 5 + ": " + ss1.Contains(5));
     Console.ReadKey();
 }
开发者ID:RavingRabbit,项目名称:Labs,代码行数:15,代码来源:Program.cs

示例3: CodeSnippet

 internal CodeSnippet(
     string code,
     IEnumerable<string> tags,
     CodeContext context = null)
 {
     if (tags == null)
         throw new ArgumentException("tags");
     Code = code ?? string.Empty;
     Authors = context != null ? context.Authors : string.Empty;
     Source = context != null ? context.Source : string.Empty;
     Syntax = context != null ? context.Syntax : string.Empty;
     SpecificTags = new SortedSet<string>(tags);
     AllTags = context != null
                   ? new SortedSet<string>(SpecificTags.Union(context.AllTags))
                   : new SortedSet<string>(SpecificTags);
     Context = context;
 }
开发者ID:CrowdKnowledge,项目名称:codetag,代码行数:17,代码来源:CodeSnippet.cs

示例4: QonverterSettingsByAnalysisControl

        public QonverterSettingsByAnalysisControl (IDictionary<Analysis, QonverterSettings> qonverterSettingsByAnalysis,
                                                   QonverterSettingsManagerNeeded qonverterSettingsManagerNeeded)
        {
            InitializeComponent();

            if (qonverterSettingsManagerNeeded == null)
                throw new NullReferenceException();

            this.qonverterSettingsByAnalysis = qonverterSettingsByAnalysis;
            this.qonverterSettingsManagerNeeded = qonverterSettingsManagerNeeded;

            qonverterSettingsByName = QonverterSettings.LoadQonverterSettings();

            qonverterSettingsByName.Keys.ToList().ForEach(o => qonverterSettingsColumn.Items.Add(o));
            qonverterSettingsColumn.Items.Add("Edit...");

            foreach (var kvp in qonverterSettingsByAnalysis)
            {
                Analysis a = kvp.Key;
                var row = new DataGridViewRow();
                row.CreateCells(dataGridView);

                IEnumerable<AnalysisParameter> diffParameters = new SortedSet<AnalysisParameter>();
                foreach (var a2 in qonverterSettingsByAnalysis.Keys)
                {
                    if (a.Software.Name != a2.Software.Name)
                        continue;

                    diffParameters = diffParameters.Union(a.Parameters.Except(a2.Parameters));
                }

                string key = a.Id + ": " + a.Name;
                foreach (var p in diffParameters)
                    key += String.Format("; {0}={1}", p.Name, p.Value);

                string defaultDecoyPrefix = a.Parameters.Where(o => o.Name.Contains("DecoyPrefix")).Select(o => o.Value).FirstOrDefault() ??
                                            Properties.Settings.Default.DefaultDecoyPrefix;

                row.Tag = a;
                row.Cells[0].Value = key;
                row.Cells[1].Value = a.QonverterSettings != null ? a.QonverterSettings.DecoyPrefix : defaultDecoyPrefix;
                var comboBox = row.Cells[2] as DataGridViewComboBoxCell;
                var firstSoftwarePreset = qonverterSettingsByName.Keys.FirstOrDefault( o => o.ToLower().Contains(kvp.Key.Software.Name.ToLower()));
                if (kvp.Value == null)
                {
                    comboBox.Value = firstSoftwarePreset ?? qonverterSettingsByName.Keys.FirstOrDefault();
                }
                else
                {
                    // load default if nothing found
                    string settingsMatch = firstSoftwarePreset ?? qonverterSettingsByName.Keys.FirstOrDefault();

                    // see if database recognizes settings
                    foreach (var item in qonverterSettingsByName)
                    {
                        if (item.Value.ChargeStateHandling == kvp.Value.ChargeStateHandling &&
                            item.Value.Kernel == kvp.Value.Kernel &&
                            item.Value.MassErrorHandling == kvp.Value.MassErrorHandling &&
                            item.Value.MissedCleavagesHandling == kvp.Value.MissedCleavagesHandling &&
                            item.Value.QonverterMethod == kvp.Value.QonverterMethod &&
                            item.Value.RerankMatches == kvp.Value.RerankMatches &&
                            item.Value.TerminalSpecificityHandling == kvp.Value.TerminalSpecificityHandling &&
                            item.Value.ScoreInfoByName.SequenceEqual(kvp.Value.ScoreInfoByName))
                        {
                            settingsMatch = item.Key;
                            break;
                        }
                    }

                    // initialize combo box value
                    if (!String.IsNullOrEmpty(settingsMatch))
                        comboBox.Value = settingsMatch;
                }

                dataGridView.Rows.Add(row);
            }

            foreach (DataGridViewRow row in dataGridView.Rows)
            {
                qonverterSettingsByAnalysis[row.Tag as Analysis] = qonverterSettingsByName[(string) row.Cells[2].Value];
                qonverterSettingsByAnalysis[row.Tag as Analysis].Analysis = row.Tag as Analysis;
                qonverterSettingsByAnalysis[row.Tag as Analysis].DecoyPrefix = (string) row.Cells[1].Value;
            }

            dataGridView.CellBeginEdit += new DataGridViewCellCancelEventHandler(dataGridView_CellBeginEdit);
            dataGridView.CurrentCellDirtyStateChanged += new EventHandler(dataGridView_CurrentCellDirtyStateChanged);
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:87,代码来源:QonverterSettingsByAnalysisControl.cs


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