示例#1
0
 private void CreateConfigTree(DirectoryInfo directoryInfo, ConfigsMerger merger)
 {
     foreach (DirectoryInfo info in directoryInfo.GetDirectories())
     {
         string path = this.GetPath(info.FullName);
         this.root.FindOrCreateNode(path);
         this.CreateConfigTree(info, merger);
     }
     foreach (FileInfo info2 in directoryInfo.GetFiles())
     {
         if (this.configurationProfile.Match(info2.Name))
         {
             string         path           = this.GetPath(directoryInfo.FullName);
             ConfigTreeNode configTreeNode = this.root.FindOrCreateNode(path);
             try
             {
                 YamlNodeImpl yamlNode = YamlService.Load(info2);
                 merger.Put(configTreeNode, info2.Name, yamlNode);
             }
             catch (Exception exception1)
             {
                 throw new Exception(path, exception1);
             }
         }
     }
 }
示例#2
0
        private YamlNodeImpl LoadYaml(IReader reader)
        {
            YamlNodeImpl impl;

            using (EntryStream stream = reader.OpenEntryStream())
            {
                using (MemoryStream stream2 = new MemoryStream())
                {
                    this.TransferTo(stream, stream2);
                    stream2.Seek(0L, SeekOrigin.Begin);
                    using (StreamReader reader2 = new StreamReader(stream2))
                    {
                        impl = YamlService.Load(reader2);
                    }
                }
            }
            return(impl);
        }
        protected override void Activate()
        {
            TemplateRegistryImpl service = new TemplateRegistryImpl();

            ServiceRegistry.Current.RegisterService <TemplateRegistry>(service);
            ServiceRegistry.Current.RegisterService <ConfigEntityLoader>(new ConfigEntityLoaderImpl());
            ComponentBitIdRegistryImpl impl2 = new ComponentBitIdRegistryImpl();

            ServiceRegistry.Current.RegisterService <ComponentBitIdRegistry>(impl2);
            HandlerCollector handlerCollector = new HandlerCollector();

            ServiceRegistry.Current.RegisterService <NodeDescriptionRegistry>(new NodeDescriptionRegistryImpl());
            EngineServiceImpl impl3 = new EngineServiceImpl(service, handlerCollector, new EventMaker(handlerCollector), impl2);

            ServiceRegistry.Current.RegisterService <EngineService>(impl3);
            ServiceRegistry.Current.RegisterService <EngineServiceInternal>(impl3);
            ServiceRegistry.Current.RegisterService <TemplateRegistry>(service);
            ServiceRegistry.Current.RegisterService <GroupRegistry>(new GroupRegistryImpl());
            impl3.HandlerCollector.AddHandlerListener(impl2);
            YamlService.RegisterConverter(new EntityYamlConverter(impl3));
            YamlService.RegisterConverter(new TemplateDescriptionYamlConverter(service));
            ServiceRegistry.Current.RegisterService <FlowInstancesCache>(new FlowInstancesCache());
        }
示例#4
0
 protected override void Activate()
 {
     ServiceRegistry.Current.RegisterService <UnityTime>(new UnityTimeImpl());
     Protocol.RegisterCodecForType <Vector3>(new Vector3Codec());
     YamlService.RegisterConverter(new Vector3YamlConverter());
 }
 public GetAdvocatesForPowerBIDashboard(CloudAdvocateService cloudAdvocateService, YamlService yamlService) =>
 (_cloudAdvocateService, _yamlService) = (cloudAdvocateService, yamlService);