Exemplo n.º 1
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            var ramlProperties = new RamlProperties
            {
                Namespace       = Namespace,
                Source          = Source,
                ClientName      = ClientName,
                UseAsyncMethods = UseAsyncMethods
            };

            RamlPropertiesManager.Save(ramlProperties, ramlPath);
            DialogResult = true;
            Close();
        }
        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.º 3
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);
        }
Exemplo n.º 4
0
        public void Load(string ramlPath, string serverPath, string clientPath)
        {
            this.ramlPath = ramlPath;
            if (ramlPath.Contains(serverPath) && !ramlPath.Contains(clientPath))
            {
                isServerUseCase = true;
            }

            var ramlProperties = RamlPropertiesManager.Load(ramlPath);

            Namespace = ramlProperties.Namespace;
            Source    = ramlProperties.Source;
            if (isServerUseCase)
            {
                UseAsyncMethods = ramlProperties.UseAsyncMethods;
            }
            else
            {
                ClientName = ramlProperties.ClientName;
            }

            OnPropertyChanged("ServerVisibility");
            OnPropertyChanged("ClientVisibility");
        }