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(); }
public static async Task <IReadOnlyCollection <T> > GetAsync <T>( this IIndexReadOperations <T> readOperations, IEnumerable <object> ids, CancellationToken cancellationToken) where T : class { // Validate parameters. if (readOperations == null) { throw new ArgumentNullException(nameof(readOperations)); } if (ids == null) { throw new ArgumentNullException(nameof(ids)); } // Materialize. IReadOnlyCollection <object> materializedIds = ids.ToReadOnlyCollection(); // If no items, return. if (materializedIds.Count == 0) { return(ReadOnlyCollectionExtensions.Empty <T>()); } // Create the request. var request = new GetRequest { Ids = materializedIds, Take = materializedIds.Count }; // Return the response. return((await readOperations.GetAsync(request, cancellationToken) .ConfigureAwait(false)).Hits.Select(h => h.Item).ToReadOnlyCollection()); }
public TryStatementAst(IScriptExtent extent, StatementBlockAst body, IEnumerable<CatchClauseAst> catchClauses, StatementBlockAst @finally) : base(extent) { this.Body = body; this.CatchClauses = catchClauses.ToReadOnlyCollection(); this.Finally = @finally; }
public PickleStep(PickleStepArgument argument, IEnumerable <string> astNodeIds, string id, string text) { Id = id; Text = text; Argument = argument; AstNodeIds = astNodeIds.ToReadOnlyCollection(); }
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(); }
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(); }
/// <summary> /// Default constructor /// </summary> /// <param name="headings">Table headings</param> /// <param name="content">Collection of rows</param> /// <param name="heading">Element heading</param> /// <param name="level">Element heading level</param> public Table(IEnumerable <IText> headings, IEnumerable <IReadOnlyCollection <IElement> > content, string heading = "", int level = 0) { Headings = headings.ToReadOnlyCollection(); Content = content.ToReadOnlyCollection(); Heading = heading; Level = level; }
/// <summary> /// Constructor for view with arguments /// </summary> public ViewData(string name, IEnumerable <string> arguments) { Name = name ?? throw new ArgumentNullException(nameof(name)); HasArguments = true; NamedArguments = new Dictionary <string, string>(); Arguments = arguments.ToReadOnlyCollection(); }
public ContentTypeDefinition(string name, string displayName, IEnumerable<ContentTypePartDefinition> parts, SettingsDictionary settings) { Name = name; DisplayName = displayName; Parts = parts.ToReadOnlyCollection(); Settings = settings; }
public Project(string directory, string fileName, string outputName, IEnumerable <Dependency> dependencies) { this.Directory = directory; this.FileName = fileName; this.OutputName = outputName; this.Dependencies = dependencies.ToReadOnlyCollection(); }
public ContentTypeDefinition(string name, string displayName, IEnumerable <ContentTypePartDefinition> parts, SettingsDictionary settings) { Name = name; DisplayName = displayName; Parts = parts.ToReadOnlyCollection(); Settings = settings; }
private static ListInitExpression ListInitExtracted(NewExpression newExpression, IEnumerable <ElementInit> initializers) { var initializerList = initializers.ToReadOnlyCollection(); ValidateListInitArgs(newExpression.Type, initializerList, nameof(newExpression)); return(new ListInitExpression(newExpression, initializerList)); }
/// <summary> /// Initializes a new instance of the <see cref="ParsedOptionSet" /> class. /// </summary> /// <param name="arguments">A <see cref="string" /> collection with arguments that are not associated to any <see cref="Option" />. These are the first arguments before any option parameter, e.g. anything before "-a".</param> /// <param name="options">A collection of <see cref="ParsedOption" /> objects that were parsed from the given commandline.</param> public ParsedOptionSet(IEnumerable <string> arguments, IEnumerable <ParsedOption> options) { Arguments = arguments.ToReadOnlyCollection(); Options = options.ToReadOnlyCollection(); Validate = new ValidateHelper(this); Assert = new AssertHelper(this); }
public ParameterAst(IScriptExtent extent, VariableExpressionAst name, IEnumerable <AttributeBaseAst> attributes, ExpressionAst defaultValue) : base(extent) { this.Name = name; this.Attributes = attributes.ToReadOnlyCollection(); this.DefaultValue = defaultValue; }
public DataStatementAst(IScriptExtent extent, string variableName, IEnumerable<ExpressionAst> commandsAllowed, StatementBlockAst body) : base(extent) { this.Variable = variableName; this.CommandsAllowed = commandsAllowed.ToReadOnlyCollection(); this.Body = body; }
public PropertyDefinitionExpression(string propertyName, Type propertyType, bool isPredeclaration, IEnumerable<string> modifiers) { this.PropertyType = propertyType; this.PropertyName = propertyName; this.IsPredeclaration = isPredeclaration; this.Modifiers = modifiers.ToReadOnlyCollection(); }
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(); }
public DataStatementAst(IScriptExtent extent, string variableName, IEnumerable <ExpressionAst> commandsAllowed, StatementBlockAst body) : base(extent) { this.Variable = variableName; this.CommandsAllowed = commandsAllowed.ToReadOnlyCollection(); this.Body = body; }
public PropertyDefinitionExpression(string propertyName, Type propertyType, bool isPredeclaration, IEnumerable <string> modifiers) { this.PropertyType = propertyType; this.PropertyName = propertyName; this.IsPredeclaration = isPredeclaration; this.Modifiers = modifiers.ToReadOnlyCollection(); }
protected override Expression VisitColumnDefinition(SqlColumnDefinitionExpression columnDefinitionExpression) { var autoIncrement = columnDefinitionExpression .ConstraintExpressions .Any(c => c.AutoIncrement); IEnumerable <SqlConstraintExpression> newConstraints = columnDefinitionExpression.ConstraintExpressions; if (this.columnsToMakeNotNull.Contains(columnDefinitionExpression.ColumnName)) { newConstraints = newConstraints .Concat(new SqlConstraintExpression(ConstraintType.NotNull)); } if (autoIncrement) { newConstraints = newConstraints .Where(c => !c.NotNull) .Prepend(new SqlConstraintExpression(ConstraintType.PrimaryKey)); } if (ReferenceEquals(newConstraints, columnDefinitionExpression.ConstraintExpressions)) { return(base.VisitColumnDefinition(columnDefinitionExpression)); } else { return(columnDefinitionExpression.ChangeConstraints(newConstraints.ToReadOnlyCollection())); } }
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; }
public TryStatementAst(IScriptExtent extent, StatementBlockAst body, IEnumerable <CatchClauseAst> catchClauses, StatementBlockAst @finally) : base(extent) { this.Body = body; this.CatchClauses = catchClauses.ToReadOnlyCollection(); this.Finally = @finally; }
public Root(TaskData taskData, IEnumerable <Color> folderColorOptions) { Util.RequireNotNull(taskData, "taskData"); m_taskData = taskData; Util.RequireNotNull(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(); }
internal DeviceTypeInfo(string classGuid, string className, string name, IEnumerable <DeviceInfo> devices) { ClassGuid = classGuid; ClassName = className; Name = name; Devices = devices.ToReadOnlyCollection(); }
public ParameterAst(IScriptExtent extent, VariableExpressionAst name, IEnumerable<AttributeBaseAst> attributes, ExpressionAst defaultValue) : base(extent) { this.Name = name; this.Attributes = attributes.ToReadOnlyCollection(); this.DefaultValue = defaultValue; }
/// <summary> /// Default constructor /// </summary> /// <param name="content">List content</param> /// <param name="type">List type</param> /// <param name="heading">Element heading</param> /// <param name="level">Element heading level</param> public ListElement(IEnumerable <IElement> content, ListType type = ListType.Dotted, string heading = "", int level = 0) { Content = content.ToReadOnlyCollection(); Type = type; Heading = heading; Level = level; }
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; }
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; }
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; }
private static NewArrayExpression NewArrayBoundsExtracted(Type type, IEnumerable <Expression> bounds) { var boundsList = bounds.ToReadOnlyCollection(); var dimensions = boundsList.Count; if (dimensions <= 0) { throw new ArgumentException("Bounds count cannot be less than 1", nameof(bounds)); } for (var i = 0; i < dimensions; i++) { var expr = boundsList[i]; ContractUtils.RequiresNotNull(expr, nameof(bounds), i); ExpressionUtils.RequiresCanRead(expr, nameof(bounds), i); if (!expr.Type.IsInteger()) { throw new ArgumentException("Argument must be of an integer type", i >= 0 ? $"{nameof(bounds)}[{i}]" : nameof(bounds)); } } var arrayType = dimensions == 1 ? type.MakeArrayType() : type.MakeArrayType(dimensions); return(NewArrayExpression.Make(ExpressionType.NewArrayBounds, arrayType, boundsList)); }
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(); }
private static NewExpression NewExtracted(ConstructorInfo constructor, IEnumerable <Expression> arguments, IEnumerable <MemberInfo> members) { var memberList = members.ToReadOnlyCollection(); var argList = arguments.AsArrayInternal(); ValidateNewArgs(constructor, ref argList, ref memberList); return(new NewExpression(constructor, argList, memberList)); }
/// <summary> /// Default constructor /// </summary> /// <param name="creator">Injected creator</param> /// <param name="content">Page content</param> /// <param name="subpages">Page sub-pages</param> /// <param name="heading">Element heading</param> /// <param name="level">Element heading level</param> public Page(IElementCreator creator, IEnumerable <IElement> content, IEnumerable <IPage> subpages, string heading = "", int level = 0) { m_creator = creator; Content = content.ToReadOnlyCollection(); Subpages = subpages.ToReadOnlyCollection(); Heading = heading; Level = level; }
private static MemberListBinding ListBindExtracted(MemberInfo member, IEnumerable <ElementInit> initializers) { ValidateGettableFieldOrPropertyMember(member, out var memberType); var initList = initializers.ToReadOnlyCollection(); ValidateListInitArgs(memberType, initList, nameof(member)); return(new MemberListBinding(member, initList)); }
/// <summary> /// Constructor for view with arguments /// </summary> public ViewData(string name, IEnumerable <string> arguments, bool isPrevious = false) { Name = name ?? throw new ArgumentNullException(nameof(name)); HasArguments = true; NamedArguments = new Dictionary <string, string>(); Arguments = arguments.ToReadOnlyCollection(); IsNavigatingBack = isPrevious; }
private LoadResult([NotNull] IEnumerable <Error> templateLoadErrors) { if (templateLoadErrors == null) { throw new ArgumentNullException(nameof(templateLoadErrors)); } TemplateLoadErrors = templateLoadErrors.ToReadOnlyCollection(); }
private void VerifyCursorContextFromPointers(IEnumerable <IMixedRealityPointer> pointers, CursorContextEnum context) { Assert.NotZero(pointers.ToReadOnlyCollection().Count); foreach (var pointer in pointers) { VerifyCursorContext(pointer.BaseCursor, context); } }
private void VerifyCursorStateFromPointers(IEnumerable <IMixedRealityPointer> pointers, CursorStateEnum state) { Assert.NotZero(pointers.ToReadOnlyCollection().Count); foreach (var pointer in pointers) { VerifyCursorState(pointer.BaseCursor, state); } }
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()); }
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; }
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; }
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(); }
public CommandKeyBindingSnapshot( CommandListSnapshot snapshot, IEnumerable<KeyInput> vimFirstKeyInputs, IEnumerable<CommandKeyBinding> removed, IEnumerable<CommandKeyBinding> conflicting) { _commandListSnapshot = snapshot; _vimFirstKeyInputs = vimFirstKeyInputs.ToReadOnlyCollection(); _removedBindings = removed.ToReadOnlyCollection(); _conflictingBindings = conflicting.ToReadOnlyCollection(); }
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(); }
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()); }
public CatchClauseAst(IScriptExtent extent, IEnumerable<TypeConstraintAst> catchTypes, StatementBlockAst body) : base(extent) { this.CatchTypes = catchTypes.ToReadOnlyCollection(); this.Body = body; }
public ContentTypeDefinition(string name, IEnumerable<ContentTypePartDefinition> parts) { Name = name; Parts = parts.ToReadOnlyCollection(); }
public SqlColumnDefinitionExpression(string columnName, Expression columnTypeName, IEnumerable<Expression> constraintExpressions) : this(columnName, columnTypeName, constraintExpressions.ToReadOnlyCollection()) { }
public InvokeMemberExpressionAst(IScriptExtent extent, ExpressionAst expression, CommandElementAst method, IEnumerable<ExpressionAst> arguments, bool @static) : base(extent, expression, method, @static) { this.Arguments = arguments.ToReadOnlyCollection(); }
public IndexerToken(IEnumerable<object> arguments) { this.arguments = arguments.ToReadOnlyCollection(); }
public ParamBlockAst(IScriptExtent extent, IEnumerable<AttributeAst> attributes, IEnumerable<ParameterAst> parameters) : base(extent) { this.Attributes = attributes.ToReadOnlyCollection(); this.Parameters = parameters.ToReadOnlyCollection(); }
public BindResult(IEnumerable<SqlColumnDeclaration> columns, IEnumerable<SqlOrderByExpression> orderings) { this.Columns = columns.ToReadOnlyCollection(); this.Orderings = orderings.ToReadOnlyCollection(); }
protected CommandBaseAst(IScriptExtent extent, IEnumerable<RedirectionAst> redirections) : base(extent) { this.Redirections = redirections.ToReadOnlyCollection(); }
public CommandAst(IScriptExtent extent, IEnumerable<CommandElementAst> commandElements, TokenKind invocationOperator, IEnumerable<RedirectionAst> redirections) : base(extent, redirections) { this.CommandElements = commandElements.ToReadOnlyCollection(); this.InvocationOperator = invocationOperator; }
public ContentPartDefinition(string name, IEnumerable<ContentPartFieldDefinition> fields, SettingsDictionary settings) { Name = name; Fields = fields.ToReadOnlyCollection(); Settings = settings; }
public IfStatementAst(IScriptExtent extent, IEnumerable<Tuple<PipelineBaseAst, StatementBlockAst>> clauses, StatementBlockAst elseClause) : base(extent) { this.Clauses = clauses.ToReadOnlyCollection(); this.ElseClause = elseClause; }
public MethodDefinitionExpression(string name, IEnumerable<Expression> parameters, Type returnType, Expression body, bool isPredeclaration, string rawAttributes = "", ReadOnlyDictionary<string, string> attributes = null) : this(name, parameters.ToReadOnlyCollection(), AccessModifiers.None, returnType, body, isPredeclaration, rawAttributes, attributes) { }
public SqlInsertIntoExpression(Expression source, IEnumerable<string> columnNames, IEnumerable<string> returningAutoIncrementColumnNames, IEnumerable<Expression> valueExpressions) : this(source, columnNames.ToReadOnlyCollection(), returningAutoIncrementColumnNames.ToReadOnlyCollection(), valueExpressions.ToReadOnlyCollection()) { }
public SqlForeignKeyConstraintExpression(string constraintName, IEnumerable<string> columnNames, SqlReferencesColumnExpression referencesColumnExpression) : this(constraintName, columnNames.ToReadOnlyCollection(), referencesColumnExpression) { }
public StatementBlockAst(IScriptExtent extent, IEnumerable<StatementAst> statements, IEnumerable<TrapStatementAst> traps) : base(extent) { this.Statements = statements.ToReadOnlyCollection(); this.Traps = traps.ToReadOnlyCollection(); }