private Robject(List <Rvariable> initializationParameters, ObjectData objectData, Rtype actualType, Rtype viewType) { if (actualType != null && actualType.IsViewType) { throw new CannotCreateRobjectException($"Cannot create object with a view type '{actualType}' given as the actual type"); } if (actualType != null && !actualType.CanBe(viewType)) { throw new CannotCreateRobjectException($"{actualType} cannot be {viewType}"); } this.initializationParameters = initializationParameters; id = objectData?.Id; ActualType = actualType; ViewType = viewType; datas = new Dictionary <string, DataValue>(); if (!IsNull) { FillObject(objectData); } }
public Rdata(DataModel model, Rtype type) { this.model = model; Type = type; DataType = Application[model.ViewModelId]; }
protected Rparametric(string name, int groupCount, List <ParameterModel> parameterModels, List <string> marks, Rtype type) { Marks = new List <string>(marks); Type = type; parameters = new Dictionary <string, Rparameter>(); Groups = Enumerable.Range(0, groupCount).Select(_ => new List <Rparameter>()).ToList(); foreach (var parameterModel in parameterModels) { parameters[parameterModel.Name] = new Rparameter(parameterModel, this); } foreach (var paramId in parameters.Keys) { var param = parameters[paramId]; foreach (var group in param.Groups) { if (group >= Groups.Count) { throw new InvalidOperationException( $"Parameter '{param.Name}' has a group '{group}' that does not exist on '{type.Name}.{name}'." + $"There are only {Groups.Count} groups." ); } Groups[group].Add(param); } } }
public Rparameter(ParameterModel model, Rparametric owner) { this.model = model; Owner = owner; ParameterType = Application[model.ViewModelId]; }
public Roperation(OperationModel model, Rtype type) : base(model.Name, model.GroupCount, model.Parameters, model.Marks, type) { this.model = model; ResultType = model.Result.IsVoid ? Rtype.Void : Application[model.Result.ViewModelId]; }
public Rinitializer(InitializerModel model, Rtype type) : base(Constants.INITIALIZER_ID, model.GroupCount, model.Parameters, model.Marks, type) { this.model = model; }
internal Robject(ObjectData objectData, Rtype actualType, Rtype viewType) : this(null, objectData, actualType, viewType) { }
internal Robject(ReferenceData referenceData, Rtype actualType, Rtype viewType, string value) : this(Od(referenceData, value), actualType, viewType) { }
public Robject(string id, Rtype actualType, Rtype viewType) : this(Rd(id, actualType.Id, viewType.Id, id == null), actualType, viewType) { }
public Robject(string id, Rtype type) : this(id, type, type) { }
public Robject(IEnumerable <Rvariable> initializationParameters, Rtype type) : this(initializationParameters.ToList(), Od(Rd(null, type.Id, type.Id, false)), type, type) { }
public Robject As(Rtype viewType) => Type.Get(Id, viewType);