src/Microsoft.VisualStudio.Editor.UnitTests/MyExtensibility/MyExtensibilitySettingsTest.cs
/// <summary>
/// Create a text file with the given content at the given path.
/// </summary>
Create a text file with the given content at the given path.
Create a text file with the given content at the given path .
private static bool CreateFile(string filePath, string[] fileContent)
        {
            bool result = false;
            StreamWriter strWriter = null;
            try
            {
                strWriter = File.CreateText(filePath);
                foreach (string line in fileContent)
                {
                    strWriter.WriteLine(line);
                }
                result = true;
            }
            catch 
            {
            }
            finally
            {
                if (null != strWriter)
                {
                    strWriter.Close();
                }
            }
            return result;
        }
private static bool CreateFile ( string filePath , string [ ] fileContent ) { bool result = false ; StreamWriter strWriter = null ; try { strWriter = File . CreateText ( filePath ) ; foreach ( string line in fileContent ) { strWriter . WriteLine ( line ) ; } result = true ; } catch { } finally { if ( null != strWriter ) { strWriter . Close ( ) ; } } return result ; }
Create a text file with the given content at the given path.
Create a text file with the given content at the given path .
filePath
string
fileContent
string[]