예제 #1
0
파일: Program.cs 프로젝트: kishor83/opcuagw
        private static TypeContainer GetTypeContainerFromCode()
        {
            TypeContainer tc = TypeContainer.Instance;

            //UNCOMMENT THE FOLLOWING CODE until tc.GetRegistryAsXml() to genterate XML for first time
            // and copy XML into TypeConfig.xml as it will save you time from manually configuring XML
            //////register PlugIn libraries
            ////register OPC receivers, converters
            //tc.Register<ILogger, ConsoleLogger>();
            //tc.Register<IProcessor, OpcReceiver<IMessage>>("OPCUA");
            //tc.Register<IConverter<object, Tag>, OpcTagToTagStateConverter>("OPCUA");

            ////register IotHub sender
            //tc.Register<IConverter<Tag, object>, ToIotHubMessageConverter>("IotHub");
            //tc.Register<IProcessor, IoTHubSender<Tag>>("IotHub");

            ////register additional libraries from Azure Connector; we don't have to Dictionary<string, object>ally load them
            ////  as there are not expected to be changed by the PlugIn writers
            //tc.Register<IServiceHost, TelemetryHost>();

            //string configXml = tc.GetRegistryAsXml();
            //UNCOMMENT - ENDS
            string workingDirectory = ConfigUtility.GetCurrentWorkingDirectory();

            tc.AddAssemblyProbingPath(workingDirectory + @"\..\..\..\SharedBin");
            tc.LoadFromFile("TypeConfig.xml");
            return(tc);
        }