Source/NFX/IO/FileSystem/Packaging/ManifestUtils.cs
/// <summary>
/// Generates packaging manifest for the specified directory. Optionally may specify root node name
/// </summary>
/// <param name="directory">Source directory to generate manifest for</param>
/// <param name="rootNodeName">Name of root manifest node, if omitted then 'package' is defaulted</param>
/// <param name="packageName">Optional 'name' attribute value under root node</param>
/// <param name="packageLocalPath">Optional 'local-path' attribute value under root node</param>
Generates packaging manifest for the specified directory. Optionally may specify root node name
Generates packaging manifest for the specified directory . Optionally may specify root node name
public static ConfigSectionNode GeneratePackagingManifest(this FileSystemDirectory directory,
                                                                string rootNodeName = null,
                                                                string packageName = null,
                                                                string packageLocalPath = null)
      {
        if (directory==null)
         throw new NFXIOException(StringConsts.ARGUMENT_ERROR + "GeneratePackagingManifest(directory==null)");
        var conf = new MemoryConfiguration();
        conf.Create(rootNodeName.IsNullOrWhiteSpace()?CONFIG_PACKAGE_SECTION : rootNodeName);
        var root = conf.Root;
        if (packageName.IsNotNullOrWhiteSpace())
          root.AddAttributeNode(CONFIG_NAME_ATTR, packageName);
        if (packageLocalPath.IsNotNullOrWhiteSpace())
          root.AddAttributeNode(CONFIG_LOCAL_PATH_ATTR, packageLocalPath);
        buildDirLevel(root, directory);
        root.ResetModified();
        return root;
      }
public static ConfigSectionNode GeneratePackagingManifest ( this FileSystemDirectory directory , string rootNodeName = null , string packageName = null , string packageLocalPath = null ) { if ( directory == null ) throw new NFXIOException ( StringConsts . ARGUMENT_ERROR + " " ) ; var conf = new MemoryConfiguration ( ) ; conf . Create ( rootNodeName . IsNullOrWhiteSpace ( ) ? CONFIG_PACKAGE_SECTION : rootNodeName ) ; var root = conf . Root ; if ( packageName . IsNotNullOrWhiteSpace ( ) ) root . AddAttributeNode ( CONFIG_NAME_ATTR , packageName ) ; if ( packageLocalPath . IsNotNullOrWhiteSpace ( ) ) root . AddAttributeNode ( CONFIG_LOCAL_PATH_ATTR , packageLocalPath ) ; buildDirLevel ( root , directory ) ; root . ResetModified ( ) ; return root ; }
Generates packaging manifest for the specified directory.
Generates packaging manifest for the specified directory .
FileSystemDirectory
this
rootNodeName
string
Name of root manifest node, if omitted then 'package' is defaulted
Name of root manifest node if omitted then ' package ' is defaulted
packageName
string
Optional 'name' attribute value under root node
Optional ' name ' attribute value under root node
packageLocalPath
string
Optional 'local-path' attribute value under root node
Optional ' local - path ' attribute value under root node
directory
Source directory to generate manifest for
Source directory to generate manifest for