Ejemplo n.º 1
0
        public void Init(XmlConfigElement xe)
        {
            foreach (XElement xe2 in xe.GetElements("Frameworks/Framework"))
            {
                _frameworkDirectories.Add(xe2.zExplicitAttribValue("version"), xe2.zExplicitAttribValue("directory"));
            }
            _win32ResourceCompiler = new Win32ResourceCompiler(xe.Get("Win32ResourceCompiler"));
            _resourceCompiler      = new ResourceCompiler(xe.Get("ResourceCompiler"));

            //string disableMessages = xe.Get("DisableCompilerMessages");
            //if (disableMessages != null)
            //{
            //    Dictionary<string, string> disableMessagesDictionary = new Dictionary<string, string>();
            //    foreach (string messageId in zsplit.Split(disableMessages, ',', true))
            //        disableMessagesDictionary.Add(messageId, messageId);
            //    _messageFilter = compilerMessage => !disableMessagesDictionary.ContainsKey(compilerMessage.Id);
            //}
            _messageFilter = GetMessageFilter(xe.Get("DisableCompilerMessages"));

            _updateAssembly      = xe.Get("UpdateAssembly").zTryParseAs(false);;
            _updateSubDirectory  = xe.Get("UpdateAssemblySubDirectory", _updateSubDirectory);;
            _traceUpdateAssembly = xe.Get("TraceUpdateAssembly").zTryParseAs(false);
            //Trace.WriteLine("CompilerManager.Init()   :");
            //Trace.WriteLine("  UpdateAssembly         : {0}", _updateAssembly);
            //Trace.WriteLine("  UpdateSubDirectory     : {0}", _updateSubDirectory);
            //Trace.WriteLine("  TraceUpdateAssembly    : {0}", _traceUpdateAssembly);
        }
Ejemplo n.º 2
0
 public static CompilerProjectReader Create(XmlConfigElement projectXmlElement, bool isIncludeProject = false)
 {
     if (projectXmlElement != null)
     {
         return(new CompilerProjectReader(projectXmlElement, isIncludeProject));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 3
0
 private CompilerProjectReader(XmlConfigElement projectXmlElement, bool isIncludeProject = false)
 {
     if (projectXmlElement == null)
     {
         throw new PBException("projectXmlElement is null when creating pb.Compiler.CompilerProject");
     }
     _projectXmlElement = projectXmlElement;
     _projectFile       = projectXmlElement.XmlConfig.ConfigFile;
     if (_projectFile != null)
     {
         _projectDirectory = zPath.GetDirectoryName(_projectFile);
     }
     _isIncludeProject = isIncludeProject;
 }
Ejemplo n.º 4
0
        private static MegaClient GetMegaClient()
        {
            MegaClient megaClient = new MegaClient();
            //string environmentFile = XmlConfig.CurrentConfig.GetExplicit("LocalEnvironment");
            //if (!zFile.Exists(environmentFile))
            //{
            //    Trace.WriteLine("login not defined");
            //    return null;
            //}
            //string login = XDocument.Load(environmentFile).zXPathExplicitValue("Login");
            string           login         = GetMegaEnvironment().GetLogin();
            XmlConfig        localConfig   = XmlConfig.CurrentConfig.GetConfig("LocalConfig");
            XmlConfigElement configElement = localConfig.GetConfigElement($"Login[@name = '{login}']");

            if (configElement == null)
            {
                Trace.WriteLine($"unknow login \"{login}\"");
                return(null);
            }
            megaClient.Email    = configElement.GetExplicit("@email");
            megaClient.Password = configElement.GetExplicit("@password");
            megaClient.Login();
            return(megaClient);
        }