NuGet.Preprocessor.Process C# (CSharp) Méthode

Process() static private méthode

static private Process ( IPackageFile file, IPropertyProvider propertyProvider ) : string
file IPackageFile
propertyProvider IPropertyProvider
Résultat string
        internal static string Process(IPackageFile file, IPropertyProvider propertyProvider)
        {
            return Process(file.GetStream(), propertyProvider, throwIfNotFound: false);
        }

Same methods

Preprocessor::Process ( Stream stream, IPropertyProvider propertyProvider, bool throwIfNotFound = true ) : string

Usage Example

Exemple #1
0
        public static Manifest ReadFrom(Stream stream, IPropertyProvider propertyProvider)
        {
            XDocument document;

            if (propertyProvider == NullPropertyProvider.Instance)
            {
                document = XDocument.Load(stream);
            }
            else
            {
                string content = Preprocessor.Process(stream, propertyProvider);
                document = XDocument.Parse(content);
            }

            string schemaNamespace = GetSchemaNamespace(document);

            foreach (var e in document.Descendants())
            {
                // Assign the schema namespace derived to all nodes in the document.
                e.Name = XName.Get(e.Name.LocalName, schemaNamespace);
            }

            // Validate the schema
            ValidateManifestSchema(document, schemaNamespace);

            // Serialize it
            var manifest = ManifestReader.ReadManifest(document);

            // Validate before returning
            Validate(manifest);

            return(manifest);
        }
All Usage Examples Of NuGet.Preprocessor::Process