コード例 #1
0
        public void SetFormDesigner()
        {
            using (DAE.Runtime.Data.Scalar nodeTable = DataSession.Evaluate(FormDesignerNodeTypesExpression))
            {
                NodeTypeTable.Clear();
                NodeTypeTable.LoadFromString(nodeTable.AsString);
            }

            // Load the files required to register any nodes, if necessary
            if (DataSession.Server is DAE.Server.LocalServer)
            {
                IServerCursor cursor = DataSession.OpenCursor(GetFormDesignerLibraryFilesExpression);
                try
                {
                    using (DAE.Runtime.Data.IRow row = cursor.Plan.RequestRow())
                    {
                        bool          shouldLoad;
                        List <string> filesToLoad = new List <string>();

                        while (cursor.Next())
                        {
                            cursor.Select(row);
                            string fullFileName =
                                ((DAE.Server.LocalServer)DataSession.Server).GetFile
                                (
                                    (DAE.Server.LocalProcess)cursor.Plan.Process,
                                    (string)row["Library_Name"],
                                    (string)row["Name"],
                                    (DateTime)row["TimeStamp"],
                                    (bool)row["IsDotNetAssembly"],
                                    out shouldLoad
                                );
                            if (shouldLoad)
                            {
                                filesToLoad.Add(fullFileName);
                            }
                        }

                        // Load each file to ensure they can be reached by the assembly resolver hack (see AssemblyUtility)
                        foreach (string fullFileName in filesToLoad)
                        {
                            Assembly.LoadFrom(fullFileName);
                        }
                    }
                }
                finally
                {
                    DataSession.CloseCursor(cursor);
                }
            }
        }
コード例 #2
0
 public void SetLibrary(string libraryName)
 {
     DAE.Runtime.DataParams paramsValue = new DAE.Runtime.DataParams();
     paramsValue.Add(DAE.Runtime.DataParam.Create(Pipe.Process, "ALibraryName", libraryName));
     using
     (
         DAE.Runtime.Data.Scalar nodeTable =
             DataSession.Evaluate
             (
                 LibraryNodeTypesExpression,
                 paramsValue
             )
     )
     {
         NodeTypeTable.Clear();
         NodeTypeTable.LoadFromString(nodeTable.AsString);
     }
     ValidateNodeTypeTable();
 }