System.Security.SecurityElement.AddChild C# (CSharp) Method

AddChild() private method

private AddChild ( ISecurityElementFactory child ) : void
child ISecurityElementFactory
return void
        internal void AddChild(ISecurityElementFactory child)
        {
            if (child == null)
                throw new ArgumentNullException(nameof(child));

            if (_children == null)
                _children = new ArrayList(ChildrenTypical);

            _children.Add(child);
        }

Same methods

SecurityElement::AddChild ( SecurityElement child ) : void

Usage Example

Beispiel #1
0
    //removePath将要删除的路径
    static public string GetFileListXMLString(List <string> fileList, string removePath)
    {
        var root = new System.Security.SecurityElement("root");

        foreach (var item in fileList)
        {
            string fileName = Path.GetFileName(item);
            string ext      = Path.GetExtension(item);
            if (string.Compare(ext, ".meta", true) == 0)
            {
                continue;
            }

            string filePath = null;
            if (IsUseAssetBundle)
            {
                filePath = item.Replace(removePath, "");
                root.AddChild(new System.Security.SecurityElement("k", fileName.ToLower()));
                root.AddChild(new System.Security.SecurityElement("v", filePath.ToLower()));
            }
            else
            {
                filePath = item.Replace(removePath, "");
                root.AddChild(new System.Security.SecurityElement("k", fileName));
                root.AddChild(new System.Security.SecurityElement("v", filePath));
            }
        }

        return(root.ToString());
    }
All Usage Examples Of System.Security.SecurityElement::AddChild