Opc.Ua.Com.Server.ComProxy.Load C# (CSharp) Method

Load() public method

Called when the object is loaded by the COM process.
public Load ( System.Guid clsid, ApplicationConfiguration configuration ) : void
clsid System.Guid The CLSID used to activate the server.
configuration ApplicationConfiguration The application configuration for the COM process.
return void
        public virtual void Load(Guid clsid, ApplicationConfiguration configuration)
        {
            lock (m_lock)
            {
                // save the application configuration.
                m_configuration = configuration;

                // set the start time.
                m_startTime = DateTime.UtcNow;

                // look up default time zone.
                DateTime now = DateTime.Now;

                m_timebias = (int)-TimeZone.CurrentTimeZone.GetUtcOffset(now).TotalMinutes;

                if (TimeZone.CurrentTimeZone.IsDaylightSavingTime(now))
                {
                    m_timebias += 60;
                }

                // load endpoint information.
                m_endpoint = LoadConfiguredEndpoint(clsid);

                // create a dummy endpoint so the COM client receives an indication of the problem.
                if (m_endpoint == null)
                {
                    ApplicationDescription server = new ApplicationDescription();

                    server.ApplicationName = "(Missing Configuration File)";
                    server.ApplicationType = ApplicationType.Server;
                    server.ApplicationUri  = clsid.ToString();

                    m_endpoint = new ConfiguredEndpoint(server, null);
                }

                m_clsid = clsid;
                m_running = true;
                
                // connect to the server.
                OnCreateSession(null);
            }
        }