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


C# ReadOnlyCollection.ToArray方法代码示例

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


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

示例1: RuleBuilder

        public RuleBuilder(ReadOnlyCollection<ParameterExpression> parameters, LabelTarget returnLabel) {

            if (parameters.Count > 0 && typeof(CodeContext).IsAssignableFrom(parameters[0].Type)) {
                _context = parameters[0];
                var p = ArrayUtils.RemoveAt(parameters, 0);
                _parameters = p;
            } else {
                // TODO: remove the copy when we have covariant IEnumerable<T>
                _parameters = parameters.ToArray();
            }
            _return = returnLabel;
        }
开发者ID:mscottford,项目名称:ironruby,代码行数:12,代码来源:RuleBuilder.cs

示例2: RectangularCorrectionWindow

        public RectangularCorrectionWindow(ReadOnlyCollection<string> columnNames, int preselectedColumn)
        {
            InitializeComponent();
            fColumnSelect.Items.AddRange(columnNames.ToArray());
            fColumnSelect.SelectedIndex = preselectedColumn;

            this.Text = "Graunt - " + Language.GetString("rectangular.title");
            fHeader.Text = Language.GetString("rectangular.header");
            fValidColumn.Text = Language.GetString("rectangular.validColumn");
            fLonger.Text = Language.GetString("rectangular.longer");
            fCrop.Text = Language.GetString("rectangular.crop");
            fIgnore1.Text = Language.GetString("rectangular.ignore");
            fShorter.Text = Language.GetString("rectangular.shorter");
            fAppend.Text = Language.GetString("rectangular.append");
            fIgnore2.Text = Language.GetString("rectangular.ignore");
            fNext.Text = Language.GetString("rectangular.next");
        }
开发者ID:Keeehi,项目名称:Graunt,代码行数:17,代码来源:RectangularCorrectionWindow.cs

示例3: IsolatedFileSystemInfo

 internal IsolatedFileSystemInfo(IsolatedStorageFile isf, IEnumerable<string> path)
 {
     Contract.Requires(isf != null);
     Contract.Requires(path != null);
     m_isf = isf;
     m_path = path.ToReadOnlyCollection();
     m_pathString = String.Join(Path.DirectorySeparatorChar.ToString(), m_path.ToArray());
 }
开发者ID:hungdluit,项目名称:bot,代码行数:8,代码来源:IsolatedFileSystemInfo.cs

示例4: Initialize

        void Initialize(Stream stream, int index)
        {
            if (stream != null)
            {
                if (stream.CanRead)
                {
                    stream.Position = index;
                }
                _rawData = stream.GetMemoryStream(index);
                if (stream.CanRead)
                {
                    stream.Position = index;
                }
                _rawData.Position = 0;
                ID = _rawData.ToInt32();
                

                List<PropertyInfo> propertyList = new List<PropertyInfo>();

                Type t = this.GetType();
                PropertyInfo[] properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance);
                foreach (PropertyInfo prop in properties)
                {
                    bool skip = false;
                    foreach (System.Attribute attrib in prop.GetCustomAttributes(true))
                    {
                        if (attrib is ArtemisExcludedAttribute)
                        {
                            skip = true;
                            break;
                        }
                    }
                    if (!skip)
                    {
                        if (prop.Name != "ID" && prop.Name != "IncludedFields")
                        {
                            propertyList.Add(prop);
                        }
                    }
                }

                IncludedFields = new ReadOnlyCollection<bool>(ProcessBitFlags(propertyList.Count, _rawData, 4));
                int flagsize = (propertyList.Count - 1)/ 8 + 1;

                int position = 4 + flagsize;

                errors = ProcessVariableData(propertyList.ToArray(), this, _rawData, position, IncludedFields.ToArray<bool>());
                
            }
            
        }
开发者ID:russjudge,项目名称:ArtemisSBS-ProtocolSharp,代码行数:51,代码来源:VariablePackage.cs

示例5: InsertItems

 private async void InsertItems(ReadOnlyCollection<DTopic> its) {
   bool pc_items = false;
   if(_items == null) {
     lock(this) {
       if(_items == null) {
         _items = new List<InBase>();
         pc_items = true;
       }
     }
   }
   foreach(var t in its.ToArray()) {
     await AddTopic(t);
   }
   if(pc_items) {
     PropertyChangedReise("items");
   }
 }
开发者ID:Wassili-Hense,项目名称:Host.V04f,代码行数:17,代码来源:InTopic.cs


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