Beispiel #1
0
        // $$ProjectDefaultValues disable
        // used to compile without project
        public CompilerProjectReader GetDefaultProject()
        {
            string projectFile           = GetRunSourceConfig().Get("DefaultProject");
            bool   createCompilerProject = false;

            if (projectFile == null)
            {
                _defaultProjectFile      = null;
                _defaultProjectXmlConfig = null;
                _defaultProject          = null;
                Trace.WriteLine("no default project");
            }
            else if (projectFile != _defaultProjectFile)
            {
                _defaultProjectFile      = projectFile;
                _defaultProjectXmlConfig = new XmlConfig(projectFile);
                createCompilerProject    = true;
                Trace.WriteLine("create default project from \"{0}\"", _defaultProjectFile);
            }
            else
            {
                createCompilerProject = _defaultProjectXmlConfig.Refresh();
                if (createCompilerProject)
                {
                    Trace.WriteLine("refresh default project from \"{0}\"", _defaultProjectFile);
                }
            }
            if (createCompilerProject)
            {
                _defaultProject = CompilerProjectReader.Create(_defaultProjectXmlConfig.GetConfigElement("/AssemblyProject"));
            }
            return(_defaultProject);
        }
Beispiel #2
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);
        }