Пример #1
0
 public LoadDslModelCommand(
     IDslModel dslModel,
     IDataTypeProvider dataTypeProvider)
 {
     this.DslModel = dslModel;
     this.DataTypeProvider = dataTypeProvider;
 }
Пример #2
0
 public LoadDslModelCommand(
     IDslModel dslModel,
     IDataTypeProvider dataTypeProvider)
 {
     this.DslModel         = dslModel;
     this.DataTypeProvider = dataTypeProvider;
 }
Пример #3
0
 public QueryDataSourceCommand(
     IDataTypeProvider dataTypeProvider,
     IIndex<string, IQueryDataSourceCommandImplementation> repositories)
 {
     _dataTypeProvider = dataTypeProvider;
     _repositories = repositories;
 }
Пример #4
0
 public GrammarProvider(IHapiLog log) : base(log)
 {
     _messageProvider      = new MessageProvider(log);
     _segmentProvider      = new SegmentProvider(log);
     _dataTypeProvider     = new DataTypeProvider(log);
     _eventMappingProvider = new EventMappingProvider(log);
 }
Пример #5
0
 public LoadDslModelCommand(
     IDslSource dslSource,
     IDataTypeProvider dataTypeProvider)
 {
     this.DslSource = dslSource;
     this.DataTypeProvider = dataTypeProvider;
 }
Пример #6
0
        public static ProjectObjectIdentifiers Create(Project project, IDataTypeProvider typeInfo, Action <Exception> onError)
        {
            var idToNode = ImmutableDictionary.CreateBuilder <ObjectIdentifier, Node>();
            var nodeToId = ImmutableDictionary.CreateBuilder <Node, ObjectIdentifier>();


            foreach (var kp in project.Documents)
            {
                var path     = kp.Key;
                var document = kp.Value;

                try
                {
                    var index = 0;
                    foreach (var node in document.NodesInDocumentOrder)
                    {
                        var id = new ObjectIdentifier(path, index);
                        idToNode[id]   = node;
                        nodeToId[node] = id;
                        index++;
                    }
                }
                catch (Exception e)
                {
                    onError(e);
                }
            }

            return(new ProjectObjectIdentifiers
            {
                _idToNode = idToNode.ToImmutable(),
                _nodeToId = nodeToId.ToImmutable(),
            });
        }
Пример #7
0
 public GrammarProvider(IMessageProvider messageProvider, ISegmentProvider segmentProvider, IDataTypeProvider dataTypeProvider, IEventMappingProvider eventMappingProvider)
 {
     _messageProvider      = messageProvider;
     _segmentProvider      = segmentProvider;
     _dataTypeProvider     = dataTypeProvider;
     _eventMappingProvider = eventMappingProvider;
 }
Пример #8
0
 public ProjectBuild(
     string project,
     string assembly,
     IDataTypeProvider typeInfo)
 {
     Project  = project;
     Assembly = assembly;
     TypeInfo = typeInfo;
 }
Пример #9
0
        readonly Dictionary <string, IDataType> _nameToTypeCache = new Dictionary <string, IDataType>();       // optimization

        public GhostCompiler(IDataTypeProvider baseCompiler, IImmutableList <IDataType> ghostTypes)
        {
            _baseCompiler = baseCompiler;
            _ghostTypes   = ghostTypes;
            foreach (var t in ghostTypes)
            {
                _ghostTypeDict.Add(t.FullName, t);
            }
        }
Пример #10
0
 /// <summary>
 /// Constructs an instance of <see cref="ClientModelMetadataProvider"/>.
 /// </summary>
 public ClientModelMetadataProvider(
     IEntityMetadataProvider entityMetadataProvider,
     ISyntheticPropertyNameConvention syntheticPropertyNameConvention,
     IDataTypeProvider dataTypeProvider)
 {
     _entityMetadataProvider          = entityMetadataProvider;
     _syntheticPropertyNameConvention = syntheticPropertyNameConvention;
     _dataTypeProvider = dataTypeProvider;
 }
Пример #11
0
 public CodeGenerator(
     ContentTypeConfiguration contentTypeConfiguration,
     IDataTypeProvider dataTypeProvider,
     CodeGeneratorFactory factory)
 {
     this.contentTypeConfiguration = contentTypeConfiguration;
     this.dataTypeProvider         = dataTypeProvider;
     this.factory = factory;
 }
Пример #12
0
 public CodeGenerator(
     ContentTypeConfiguration contentTypeConfiguration, 
     IDataTypeProvider dataTypeProvider, 
     CodeGeneratorFactory factory)
 {
     this.contentTypeConfiguration = contentTypeConfiguration;
     this.dataTypeProvider = dataTypeProvider;
     this.factory = factory;
 }
Пример #13
0
 public QueryDataSourceCommand(
     IDataTypeProvider dataTypeProvider,
     GenericRepositories repositories,
     ServerCommandsUtility serverCommandsUtility)
 {
     _dataTypeProvider = dataTypeProvider;
     _repositories = repositories;
     _serverCommandsUtility = serverCommandsUtility;
 }
Пример #14
0
 public QueryDataSourceCommand(
     IDataTypeProvider dataTypeProvider,
     GenericRepositories repositories,
     ServerCommandsUtility serverCommandsUtility)
 {
     _dataTypeProvider      = dataTypeProvider;
     _repositories          = repositories;
     _serverCommandsUtility = serverCommandsUtility;
 }
Пример #15
0
 public ReadCommand(
     IDataTypeProvider dataTypeProvider,
     GenericRepositories repositories,
     ILogProvider logProvider,
     ServerCommandsUtility serverCommandsUtility)
 {
     _dataTypeProvider = dataTypeProvider;
     _repositories = repositories;
     _logger = logProvider.GetLogger(GetType().Name);
     _serverCommandsUtility = serverCommandsUtility;
 }
Пример #16
0
 public ReadCommand(
     IDataTypeProvider dataTypeProvider,
     GenericRepositories repositories,
     ILogProvider logProvider,
     ServerCommandsUtility serverCommandsUtility)
 {
     _dataTypeProvider      = dataTypeProvider;
     _repositories          = repositories;
     _logger                = logProvider.GetLogger(GetType().Name);
     _serverCommandsUtility = serverCommandsUtility;
 }
Пример #17
0
        public ValueParser(IDataTypeProvider compiler, string project)
        {
            _compiler = compiler;
            var valueParserCtor = GetUxilCompilerCtor();

            _valueParser = (global::Uno.UX.Markup.UXIL.Compiler)valueParserCtor.Invoke(
                new object[]
            {
                compiler,
                Path.GetDirectoryName(project),
                null,
                new MarkupErrorLog(new Log(Console.Error, Console.Error), SourcePackage.Unknown)
            });
        }
Пример #18
0
        /// <exception cref="UserCodeContainsErrors"></exception>
        Project Parse(IEnumerable <UxFileContents> documents, IDataTypeProvider ghostCompiler, IMarkupErrorLog log)
        {
            try
            {
                var markupErrorLog = new HasErrorsErrorLogWrapper(log);

                var result = Uno.UX.Markup.UXIL.Compiler.Compile(
                    ghostCompiler,
                    documents.Select(x => new Uno.UX.Markup.UXIL.Compiler.UXSource(x.Path, x.Contents)),
                    Path.GetDirectoryName(_project),
                    "Project",
                    null,
                    markupErrorLog);

                if (result == null)
                {
                    throw new UserCodeContainsErrors();
                }

                if (markupErrorLog.HasErrors)
                {
                    throw new UserCodeContainsErrors();
                }

                return(result);
            }
            catch (UserCodeContainsErrors)
            {
                throw;
            }
            catch (XmlException e)
            {
                throw new InvalidMarkup(
                          e.SourceUri,
                          new TextPosition(new LineNumber(e.LineNumber + 1), new CharacterNumber(e.LinePosition + 1)),
                          e.Message);
            }
            catch (MarkupException e)
            {
                throw new InvalidMarkup(
                          e.Source,
                          Optional.None(),
                          e.Message);
            }
            catch (Exception e)             // this dumb
            {
                throw new UnknownError(e.Message);
            }
        }
 /// <summary>
 /// Constructs an instance of <see cref="BreezeMetadataBuilder"/>.
 /// </summary>
 public BreezeMetadataBuilder(
     INHibernateClassMetadataProvider classMetadataProvider,
     IEntityMetadataProvider entityMetadataProvider,
     IBreezeConfigurator breezeConfigurator,
     IClientModelMetadataProvider clientModelMetadataProvider,
     IPropertyValidatorsProvider propertyValidatorsProvider,
     IDataTypeProvider dataTypeProvider)
 {
     _classMetadataProvider       = classMetadataProvider;
     _entityMetadataProvider      = entityMetadataProvider;
     _breezeConfigurator          = breezeConfigurator;
     _clientModelMetadataProvider = clientModelMetadataProvider;
     _propertyValidatorsProvider  = propertyValidatorsProvider;
     _dataTypeProvider            = dataTypeProvider;
 }
Пример #20
0
        public GlobalResourceCache(IDataTypeProvider dataTypeProvider)
        {
            _dataTypeProvider = dataTypeProvider;

            foreach (var r in _dataTypeProvider.DataTypes.SelectMany(x => x.GlobalResources))
            {
                if (!_handles.ContainsKey(r.GlobalSymbol))
                {
                    _handles.Add(r.GlobalSymbol, new List <Node>());
                }

                var refNode = new ResourceRefNode(FileSourceInfo.Unknown, r.FullPath, null, r.DataType, InstanceType.Global);
                _handles[r.GlobalSymbol].Add(refNode);
                if (r.GlobalSymbol != r.FullPath)
                {
                    if (_fullPaths.ContainsKey(r.FullPath))
                    {
                        throw new System.Exception("Multiple global resources with the key '" + r.FullPath + "' found in the project");
                    }
                    _fullPaths.Add(r.FullPath, refNode);
                }
            }
        }
Пример #21
0
 public static IDataArray CreateDataArray <T>(this IDataTypeProvider typeProvider, T[] data) where T : class
 {
     return(typeProvider.CreateDataArray(typeof(T), data));
 }
 public static DataType GetDataType(this IDataTypeProvider provider, IType type)
 {
     return(provider.TryGetDataType(type, out var dataType) ? dataType : provider.GetDefaultType());
 }
Пример #23
0
 public PingCommand(IDataTypeProvider dataTypeProvider)
 {
     _dataTypeProvider = dataTypeProvider;
 }
Пример #24
0
 public PingCommand(IDataTypeProvider dataTypeProvider)
 {
     _dataTypeProvider = dataTypeProvider;
 }
Пример #25
0
 public GhostCompilerFactory(IDataTypeProvider realCompiler)
 {
     _realCompiler = realCompiler;
 }
Пример #26
0
 public CachingCompiler(IDataTypeProvider baseCompiler)
 {
     _baseCompiler = baseCompiler;
     _dataTypes    = baseCompiler.DataTypes.Select(Cache).ToArray();
 }