示例#1
0
        /// <summary>
        /// Gets the template filename.
        /// </summary>
        /// <param name="validate">if set to <c>true</c> check that the file exists.</param>
        /// <returns>The template filename.</returns>
        private static string GetTemplateFilename(bool validate)
        {
            string filename = RuntimeHelper.ApplicationDataFolder(RuntimeHelper.CommonProductName);

            if (Directory.Exists(filename))
            {
                filename = Path.Combine(filename, TemplateFilename);
                if (validate && !File.Exists(filename))
                {
                    filename = null;
                }
            }

            return(filename);
        }