Ejemplo n.º 1
0
        private static TraceLab.Core.Workspaces.Workspace InitWorkspace(IEnumerable <string> typeDirectories, string workspaceDirectory, string cacheDirectory)
        {
            //Init workspace
            //TODO pass IEnumerable instead of List into workspaces...
            WorkspaceManager.InitWorkspace(new List <string>(typeDirectories), workspaceDirectory, cacheDirectory);
            TraceLab.Core.Workspaces.Workspace workspace = (TraceLab.Core.Workspaces.Workspace)WorkspaceManager.WorkspaceInstance;

            System.Reflection.Assembly sdk = System.Reflection.Assembly.GetAssembly(typeof(TraceLabSDK.IWorkspace));

            foreach (Type type in sdk.GetTypes())
            {
                if (type.Namespace.Equals("TraceLabSDK.Types"))
                {
                    workspace.RegisterType(type);
                }
            }

            return(workspace);
        }