Exemplo n.º 1
0
 private static void LoadClientTypeAssemblies()
 {
     try
     {
         ScriptTypeMap.LoadAssembliesDefinedInConfigFile();
     }
     catch (Exception ex)
     {
         if (ScriptTypeMap.IsFatalException(ex))
         {
             throw;
         }
     }
     try
     {
         ScriptTypeMap.LoadAssembliesDefinedInProgramFiles();
     }
     catch (Exception ex2)
     {
         if (ScriptTypeMap.IsFatalException(ex2))
         {
             throw;
         }
     }
 }
Exemplo n.º 2
0
        private static void LoadAssembliesDefinedInProgramFiles()
        {
            string text = ClientUtility.GetSetupDirectory();

            if (string.IsNullOrEmpty(text))
            {
                return;
            }
            text = Path.Combine(text, "TypeAssemblies");
            if (Directory.Exists(text))
            {
                string[] files = Directory.GetFiles(text, "ClientTypeAssembly.*.xml");
                for (int i = 0; i < files.Length; i++)
                {
                    string path = files[i];
                    try
                    {
                        using (TextReader textReader = System.IO.File.OpenText(path))
                        {
                            //XmlDocument xmlDocument = new XmlDocument();
                            //xmlDocument.Load(XmlReader.Create(textReader));
                            //foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes)
                            //{
                            //    if (xmlNode.NodeType == XmlNodeType.Element && xmlNode.Name == "AssemblyName")
                            //    {
                            //        Assembly.Load(xmlNode.InnerText);
                            //    }
                            //}
                        }
                    }
                    catch (Exception ex)
                    {
                        if (ScriptTypeMap.IsFatalException(ex))
                        {
                            throw;
                        }
                    }
                }
            }
        }