public static string AddRefFile(string ramlSourceFile, string destFolderPath, string targetFileName, RamlProperties properties)
        {
            var refFileName = Path.GetFileNameWithoutExtension(targetFileName) + ".ref";
            var refFilePath = Path.Combine(destFolderPath, refFileName);
            var content     = RamlPropertiesManager.BuildContent(properties);

            if (File.Exists(refFilePath))
            {
                new FileInfo(refFilePath).IsReadOnly = false;
            }

            File.WriteAllText(refFilePath, content);
            new FileInfo(refFilePath).IsReadOnly = true;

            return(refFilePath);
        }
Exemplo n.º 2
0
        public static string AddRefFile(string ramlSourceFile, string targetNamespace, string ramlOriginalSource, string destFolderPath, string targetFileName, bool?useAsyncMethods = null, string clientRootClassName = null)
        {
            var refFileName = Path.GetFileNameWithoutExtension(targetFileName) + ".ref";
            var refFilePath = Path.Combine(destFolderPath, refFileName);
            var content     = RamlPropertiesManager.BuildContent(targetNamespace, ramlOriginalSource, useAsyncMethods, clientRootClassName);

            if (File.Exists(refFilePath))
            {
                new FileInfo(refFilePath).IsReadOnly = false;
            }

            File.WriteAllText(refFilePath, content);
            new FileInfo(refFilePath).IsReadOnly = true;

            return(refFilePath);
        }