Beispiel #1
0
        private NHConfigFile GetNhConfigFile(string filepath)
        {
            nhConfigFile = null;

            if (!File.Exists(filepath))
            {
                return(null);
            }

            try
            {
                nhConfigFile = ProjectLoader.GetNhConfigFile(filepath);
            }
            catch
            {
                // Do nothing. We are probably trying to process a non-XML file.
            }
            return(nhConfigFile);
        }
Beispiel #2
0
        private NHConfigFile GetNhConfigFileFromCsprojFile(string filepath)
        {
            nhConfigFile = null;

            if (!File.Exists(filepath))
            {
                return(null);
            }

            try
            {
                // Check whether we can find a config file
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(File.ReadAllText(filepath));
                CSProjFile csProjFile = new CSProjFile(doc, tbProjectLocation.Text);
                Slyce.Common.FileController fileController = new FileController();
                nhConfigFile = ProjectLoader.GetNhConfigFile(csProjFile, fileController);
            }
            catch
            {
                // Do nothing. We are probably trying to process a non-XML file.
            }
            return(nhConfigFile);
        }