本文整理汇总了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;
}
示例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");
}
示例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());
}
示例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>());
}
}
示例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");
}
}