GetInstance() public static méthode

public static GetInstance ( object obj ) : SmimeCapability
obj object
Résultat SmimeCapability
        /**
         * returns an ArrayList with 0 or more objects of all the capabilities
         * matching the passed in capability Oid. If the Oid passed is null the
         * entire set is returned.
         */
        public ArrayList GetCapabilities(
            DerObjectIdentifier capability)
        {
            ArrayList list = new ArrayList();

            if (capability == null)
            {
                foreach (object o in capabilities)
                {
                    SmimeCapability cap = SmimeCapability.GetInstance(o);

                    list.Add(cap);
                }
            }
            else
            {
                foreach (object o in capabilities)
                {
                    SmimeCapability cap = SmimeCapability.GetInstance(o);

                    if (capability.Equals(cap.CapabilityID))
                    {
                        list.Add(cap);
                    }
                }
            }

            return(list);
        }
 private void DoGetCapabilitiesForOid(DerObjectIdentifier capability, global::System.Collections.IList list)
 {
     global::System.Collections.IEnumerator enumerator;
     if (capability == null)
     {
         {
             enumerator = capabilities.GetEnumerator();
             try
             {
                 while (enumerator.MoveNext())
                 {
                     object          current  = enumerator.get_Current();
                     SmimeCapability instance = SmimeCapability.GetInstance(current);
                     list.Add((object)instance);
                 }
             }
             finally
             {
                 global::System.IDisposable disposable = enumerator as global::System.IDisposable;
                 if (disposable != null)
                 {
                     disposable.Dispose();
                 }
             }
         }
         return;
     }
     enumerator = capabilities.GetEnumerator();
     try
     {
         while (enumerator.MoveNext())
         {
             object          current2  = enumerator.get_Current();
             SmimeCapability instance2 = SmimeCapability.GetInstance(current2);
             if (capability.Equals(instance2.CapabilityID))
             {
                 list.Add((object)instance2);
             }
         }
     }
     finally
     {
         global::System.IDisposable disposable2 = enumerator as global::System.IDisposable;
         if (disposable2 != null)
         {
             disposable2.Dispose();
         }
     }
 }
Exemple #3
0
        private void DoGetCapabilitiesForOid(DerObjectIdentifier capability, IList list)
        {
            if (capability == null)
            {
                foreach (object o in capabilities)
                {
                    SmimeCapability cap = SmimeCapability.GetInstance(o);

                    list.Add(cap);
                }
            }
            else
            {
                foreach (object o in capabilities)
                {
                    SmimeCapability cap = SmimeCapability.GetInstance(o);

                    if (capability.Equals(cap.CapabilityID))
                    {
                        list.Add(cap);
                    }
                }
            }
        }
 private void DoGetCapabilitiesForOid(DerObjectIdentifier capability, IList list)
 {
     if (capability == null)
     {
         using (IEnumerator enumerator = this.capabilities.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 object          current  = enumerator.Current;
                 SmimeCapability instance = SmimeCapability.GetInstance(current);
                 list.Add(instance);
             }
             return;
         }
     }
     foreach (object current2 in this.capabilities)
     {
         SmimeCapability instance2 = SmimeCapability.GetInstance(current2);
         if (capability.Equals(instance2.CapabilityID))
         {
             list.Add(instance2);
         }
     }
 }