RemoveChild() public méthode

public RemoveChild ( PkixPolicyNode child ) : void
child PkixPolicyNode
Résultat void
Exemple #1
0
        internal static PkixPolicyNode RemovePolicyNode(
            PkixPolicyNode validPolicyTree,
            IList[] policyNodes,
            PkixPolicyNode _node)
        {
            PkixPolicyNode _parent = (PkixPolicyNode)_node.Parent;

            if (validPolicyTree == null)
            {
                return(null);
            }

            if (_parent == null)
            {
                for (int j = 0; j < policyNodes.Length; j++)
                {
                    policyNodes[j] = Platform.CreateArrayList();
                }

                return(null);
            }
            else
            {
                _parent.RemoveChild(_node);
                RemovePolicyNodeRecurse(policyNodes, _node);

                return(validPolicyTree);
            }
        }
Exemple #2
0
        internal static PkixPolicyNode PrepareNextCertB2(int i, IList[] policyNodes, string id_p, PkixPolicyNode validPolicyTree)
        {
            int num = 0;

            foreach (PkixPolicyNode pkixPolicyNode in Platform.CreateArrayList(policyNodes[i]))
            {
                if (pkixPolicyNode.ValidPolicy.Equals(id_p))
                {
                    PkixPolicyNode parent = pkixPolicyNode.Parent;
                    parent.RemoveChild(pkixPolicyNode);
                    policyNodes[i].RemoveAt(num);
                    for (int j = i - 1; j >= 0; j--)
                    {
                        IList list = policyNodes[j];
                        for (int k = 0; k < list.Count; k++)
                        {
                            PkixPolicyNode pkixPolicyNode2 = (PkixPolicyNode)list[k];
                            if (!pkixPolicyNode2.HasChildren)
                            {
                                validPolicyTree = PkixCertPathValidatorUtilities.RemovePolicyNode(validPolicyTree, policyNodes, pkixPolicyNode2);
                                if (validPolicyTree == null)
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    num++;
                }
            }
            return(validPolicyTree);
        }
Exemple #3
0
        internal static PkixPolicyNode PrepareNextCertB2(int i, global::System.Collections.IList[] policyNodes, string id_p, PkixPolicyNode validPolicyTree)
        {
            int num = 0;

            global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)Platform.CreateArrayList((global::System.Collections.ICollection)policyNodes[i])).GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    PkixPolicyNode pkixPolicyNode = (PkixPolicyNode)enumerator.get_Current();
                    if (pkixPolicyNode.ValidPolicy.Equals(id_p))
                    {
                        PkixPolicyNode parent = pkixPolicyNode.Parent;
                        parent.RemoveChild(pkixPolicyNode);
                        policyNodes[i].RemoveAt(num);
                        for (int num2 = i - 1; num2 >= 0; num2--)
                        {
                            global::System.Collections.IList list = policyNodes[num2];
                            for (int j = 0; j < ((global::System.Collections.ICollection)list).get_Count(); j++)
                            {
                                PkixPolicyNode pkixPolicyNode2 = (PkixPolicyNode)list.get_Item(j);
                                if (!pkixPolicyNode2.HasChildren)
                                {
                                    validPolicyTree = RemovePolicyNode(validPolicyTree, policyNodes, pkixPolicyNode2);
                                    if (validPolicyTree == null)
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        num++;
                    }
                }
                return(validPolicyTree);
            }
            finally
            {
                global::System.IDisposable disposable = enumerator as global::System.IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
Exemple #4
0
        internal static PkixPolicyNode PrepareNextCertB2(
            int i,
            IList[]                 policyNodes,
            string id_p,
            PkixPolicyNode validPolicyTree)
        {
            int pos = 0;

            // Copy to avoid RemoveAt calls interfering with enumeration
            foreach (PkixPolicyNode node in Platform.CreateArrayList(policyNodes[i]))
            {
                if (node.ValidPolicy.Equals(id_p))
                {
                    PkixPolicyNode p_node = (PkixPolicyNode)node.Parent;
                    p_node.RemoveChild(node);

                    // Removal of element at current iterator position not supported in C#
                    //nodes_i.remove();
                    policyNodes[i].RemoveAt(pos);

                    for (int k = (i - 1); k >= 0; k--)
                    {
                        IList nodes = policyNodes[k];
                        for (int l = 0; l < nodes.Count; l++)
                        {
                            PkixPolicyNode node2 = (PkixPolicyNode)nodes[l];
                            if (!node2.HasChildren)
                            {
                                validPolicyTree = RemovePolicyNode(validPolicyTree, policyNodes, node2);
                                if (validPolicyTree == null)
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                else
                {
                    ++pos;
                }
            }
            return(validPolicyTree);
        }
Exemple #5
0
        internal static PkixPolicyNode RemovePolicyNode(PkixPolicyNode validPolicyTree, global::System.Collections.IList[] policyNodes, PkixPolicyNode _node)
        {
            PkixPolicyNode parent = _node.Parent;

            if (validPolicyTree == null)
            {
                return(null);
            }
            if (parent == null)
            {
                for (int i = 0; i < policyNodes.Length; i++)
                {
                    policyNodes[i] = Platform.CreateArrayList();
                }
                return(null);
            }
            parent.RemoveChild(_node);
            RemovePolicyNodeRecurse(policyNodes, _node);
            return(validPolicyTree);
        }
Exemple #6
0
        internal static PkixPolicyNode RemovePolicyNode(PkixPolicyNode validPolicyTree, IList[] policyNodes, PkixPolicyNode _node)
        {
            PkixPolicyNode parent = _node.Parent;

            if (validPolicyTree == null)
            {
                return(null);
            }
            if (parent == null)
            {
                for (int i = 0; i < policyNodes.Length; i++)
                {
                    policyNodes[i] = Platform.CreateArrayList();
                }
                return(null);
            }
            parent.RemoveChild(_node);
            PkixCertPathValidatorUtilities.RemovePolicyNodeRecurse(policyNodes, _node);
            return(validPolicyTree);
        }