Exemplo n.º 1
0
        /// <summary>
        /// Loads the component based on the provided component metadata.
        /// </summary>
        /// <param name="logger">The logger - logger provided for the component.</param>
        public void Load(ComponentLogger logger)
        {
            if (LoadedComponent == null)
            {
                Assembly tlcompAssembly = Assembly.LoadFrom(m_metadata.ComponentMetadataDefinition.Assembly);
                Type     myLoadClass    = tlcompAssembly.GetType(m_metadata.ComponentMetadataDefinition.Classname); // LoadClass is my class

                if (myLoadClass == null)
                {
                    throw new ComponentsLibraryException("Component class " + m_metadata.ComponentMetadataDefinition.Classname + " could not be loaded.");
                }

                LoadedComponent = (IComponent)Activator.CreateInstance(myLoadClass, new Object[] { logger });

                //create workspace wrapper for the component
                IWorkspace workspaceWrapper = WorkspaceWrapperFactory.CreateWorkspaceWrapper(m_metadata, m_workspace);

                LoadedComponent.Workspace = workspaceWrapper;
                SetConfiguration();
            }
        }
Exemplo n.º 2
0
 private IWorkspaceInternal CreateWorkspaceWrapper(ComponentMetadata metadata)
 {
     return(WorkspaceWrapperFactory.CreateWorkspaceWrapper(metadata, WorkspaceManager.WorkspaceInternalInstance));
 }