本文整理汇总了C#中IEnumerable.ToReadOnlyCollection方法的典型用法代码示例。如果您正苦于以下问题:C# IEnumerable.ToReadOnlyCollection方法的具体用法?C# IEnumerable.ToReadOnlyCollection怎么用?C# IEnumerable.ToReadOnlyCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEnumerable
的用法示例。
在下文中一共展示了IEnumerable.ToReadOnlyCollection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DataStatementAst
public DataStatementAst(IScriptExtent extent, string variableName, IEnumerable<ExpressionAst> commandsAllowed, StatementBlockAst body)
: base(extent)
{
this.Variable = variableName;
this.CommandsAllowed = commandsAllowed.ToReadOnlyCollection();
this.Body = body;
}
示例2: PropertyDefinitionExpression
public PropertyDefinitionExpression(string propertyName, Type propertyType, bool isPredeclaration, IEnumerable<string> modifiers)
{
this.PropertyType = propertyType;
this.PropertyName = propertyName;
this.IsPredeclaration = isPredeclaration;
this.Modifiers = modifiers.ToReadOnlyCollection();
}
示例3: Root
public Root(TaskData taskData, IEnumerable<Color> folderColorOptions)
{
Contract.Requires(null != taskData, "taskData");
m_taskData = taskData;
Contract.Requires(null != folderColorOptions, "folderColorOptions");
m_folderColorOptions = folderColorOptions.ToReadOnlyCollection();
Tasks = new TaskListViewModel(taskData, filter);
Timeline = new TimelineViewModel(Tasks.AllTasks);
Filters = new Filters(taskData);
Folders = new Folders(taskData);
taskData.PropertyChanged += (sender, args) =>
{
if (args.PropertyName == "CurrentFolder" || args.PropertyName == "Filter")
{
Tasks.RefreshFilter();
}
};
DispatcherTimer dateChanger = new DispatcherTimer();
dateChanger.Interval = TimeSpan.FromMinutes(1);
dateChanger.Tick += new EventHandler(dateChanger_Tick);
Tasks.RefreshFilter();
}
示例4: ExecutionPlan
internal ExecutionPlan( IEnumerable<IPluginInfo> pluginsToStart, IEnumerable<IPluginInfo> pluginsToStop, IReadOnlyCollection<IPluginInfo> pluginsToDisable )
{
Debug.Assert( pluginsToStart != null && pluginsToStop != null && pluginsToDisable != null );
PluginsToStart = pluginsToStart.ToReadOnlyCollection();
PluginsToStop = pluginsToStop.ToReadOnlyCollection();
PluginsToDisable = pluginsToDisable;
}
示例5: SimpleLambdaExpression
public SimpleLambdaExpression(Type returnType, Expression body, IEnumerable<Expression> variables, params Expression[] parameters)
{
this.ReturnType = returnType;
this.Body = body;
this.Variables = variables.ToReadOnlyCollection();
this.Parameters = parameters.ToReadOnlyCollection();
}
示例6: ContentTypeDefinition
public ContentTypeDefinition(string name, string displayName, IEnumerable<ContentTypePartDefinition> parts, SettingsDictionary settings)
{
Name = name;
DisplayName = displayName;
Parts = parts.ToReadOnlyCollection();
Settings = settings;
}
示例7: TryStatementAst
public TryStatementAst(IScriptExtent extent, StatementBlockAst body, IEnumerable<CatchClauseAst> catchClauses, StatementBlockAst @finally)
: base(extent)
{
this.Body = body;
this.CatchClauses = catchClauses.ToReadOnlyCollection();
this.Finally = @finally;
}
示例8: ServiceModel
public ServiceModel(ServiceModelInfo serviceModelInfo, IEnumerable<ServiceEnum> enums, IEnumerable<ServiceClass> classes, IEnumerable<ServiceGateway> gateways)
{
this.ServiceModelInfo = serviceModelInfo ?? new ServiceModelInfo();
this.Enums = enums.ToReadOnlyCollection();
this.Classes = classes.ToReadOnlyCollection();
this.Gateways = gateways.ToReadOnlyCollection();
}
示例9: ParameterAst
public ParameterAst(IScriptExtent extent, VariableExpressionAst name, IEnumerable<AttributeBaseAst> attributes, ExpressionAst defaultValue)
: base(extent)
{
this.Name = name;
this.Attributes = attributes.ToReadOnlyCollection();
this.DefaultValue = defaultValue;
}
示例10: SwitchStatementAst
public SwitchStatementAst(IScriptExtent extent, string label, PipelineBaseAst condition, SwitchFlags flags, IEnumerable<Tuple<ExpressionAst, StatementBlockAst>> clauses, StatementBlockAst @default)
: base(extent, label, condition)
{
this.Flags = flags;
this.Clauses = clauses.ToReadOnlyCollection();
this.Default = @default;
}
示例11: FunctionDefinitionAst
public FunctionDefinitionAst(IScriptExtent extent, bool isFilter, bool isWorkflow, string name, IEnumerable<ParameterAst> parameters, ScriptBlockAst body)
: base(extent)
{
this.IsFilter = isFilter;
this.IsWorkflow = isWorkflow;
this.Name = name;
this.Parameters = parameters.ToReadOnlyCollection();
this.Body = body;
}
示例12: FunctionInfo
internal FunctionInfo(string name, ScriptBlock function, IEnumerable<ParameterAst> explicitParams,
ScopedItemOptions options)
: base(name, CommandTypes.Function)
{
ScriptBlock = function;
Options = options;
ScopeUsage = ScopeUsages.NewScope;
_explicitParameters = explicitParams == null ? new ReadOnlyCollection<ParameterAst>(new ParameterAst[0])
: explicitParams.ToReadOnlyCollection();
}
示例13: CommandKeyBindingSnapshot
public CommandKeyBindingSnapshot(
CommandListSnapshot snapshot,
IEnumerable<KeyInput> vimFirstKeyInputs,
IEnumerable<CommandKeyBinding> removed,
IEnumerable<CommandKeyBinding> conflicting)
{
_commandListSnapshot = snapshot;
_vimFirstKeyInputs = vimFirstKeyInputs.ToReadOnlyCollection();
_removedBindings = removed.ToReadOnlyCollection();
_conflictingBindings = conflicting.ToReadOnlyCollection();
}
示例14: MethodDefinitionExpression
public MethodDefinitionExpression(string name, ReadOnlyCollection<Expression> parameters, AccessModifiers accessModifiers, Type returnType, Expression body, bool isPredeclaration, string rawAttributes = "", ReadOnlyDictionary<string, string> attributes = null, IEnumerable<Exception> exceptions = null)
{
this.RawAttributes = rawAttributes;
this.Attributes = attributes ?? new ReadOnlyDictionary<string, string>(new Dictionary<string, string>());
this.Name = name;
this.AccessModifiers = accessModifiers;
this.ReturnType = returnType;
this.Parameters = parameters;
this.Body = body;
this.IsPredeclaration = isPredeclaration;
this.Exceptions = exceptions == null ? null : exceptions.ToReadOnlyCollection();
}
示例15: SqlForeignKeyConstraintExpression
public SqlForeignKeyConstraintExpression(string constraintName, IEnumerable<string> columnNames, SqlReferencesColumnExpression referencesColumnExpression)
: this(constraintName, columnNames.ToReadOnlyCollection(), referencesColumnExpression)
{
}