Esempio n. 1
0
 public Anchor Add(Anchor anchor)
 {
     using (ConfigDatabase db = this.Store.CreateContext())
     {
         this.Add(db, anchor);
         db.SubmitChanges();
         return anchor;
     }
 }
Esempio n. 2
0
 public void Add(ConfigDatabase db, Anchor anchor)
 {
     if (db == null)
     {
         throw new ArgumentNullException("db");
     }
     if (anchor == null)
     {
         throw new ConfigStoreException(ConfigStoreError.InvalidAnchor);
     }
     
     db.Anchors.InsertOnSubmit(anchor);
 }
Esempio n. 3
0
        Anchor ApplyGetOptions(Anchor anchor, CertificateGetOptions options)
        {
            if (options == null)
            {
                options = CertificateGetOptions.Default;
            }

            return options.ApplyTo(anchor);
        }
Esempio n. 4
0
        Anchor[] ApplyGetOptions(Anchor[] anchors, CertificateGetOptions options)
        {
            if (anchors == null)
            {
                return null;
            }

            return (from anchor in
                        (from anchor in anchors
                         select ApplyGetOptions(anchor, options)
                        )
                    where anchor != null
                    select anchor).ToArray();
        }
Esempio n. 5
0
 public void AddAnchors(Anchor[] anchors)
 {
     try
     {
         Store.Anchors.Add(anchors);
     }
     catch (Exception ex)
     {
         throw CreateFault("AddAnchors", ex);
     }
 }
Esempio n. 6
0
 public Anchor AddAnchor(Anchor anchor)
 {
     try
     {
         return Store.Anchors.Add(anchor);
     }
     catch (Exception ex)
     {
         throw CreateFault("AddAnchors", ex);
     }
 }
Esempio n. 7
0
            X509Certificate2Collection ToCerts(Anchor[] anchors)
            {
                if (anchors == null)
                {
                    return null;
                }
                X509Certificate2Collection certs = new X509Certificate2Collection();
                for (int i = 0; i < anchors.Length; ++i)
                {
                    certs.Add(anchors[i].ToX509Certificate());
                }

                return certs;
            }
Esempio n. 8
0
 public Anchor Update(Anchor anchor)
 {
     throw new NotSupportedException("Updating anchors not supported");
 }
Esempio n. 9
0
 public Anchor ChangeStatus(Anchor anchor, EntityStatus status)
 {
     Client.SetAnchorStatus(new[] { anchor.ID }, status);
     anchor.Status = status;
     return anchor;
 }
Esempio n. 10
0
 public void Delete(Anchor anchor)
 {
     Client.RemoveAnchors(new[] {anchor.ID});
 }
Esempio n. 11
0
 public Anchor Add(Anchor anchor)
 {
     return Client.AddAnchor(anchor);
 }
Esempio n. 12
0
        internal Anchor ApplyTo(Anchor anchor)
        {
            if (anchor == null)
            {
                return anchor;
            }

            if (this.Status != null && Status.Value != anchor.Status)
            {
                return null;
            }
            
            if (!this.IncludeData)
            {
                anchor.ClearData();
            }

            return anchor;
        }
Esempio n. 13
0
 public static void AddAnchor(this AnchorStoreClient client, Anchor anchor)
 {
     client.AddAnchors(new Anchor[] {anchor});
 }
Esempio n. 14
0
 public static X509Certificate2Collection ToX509Collection(Anchor[] anchors)
 {
     if (anchors.IsNullOrEmpty())
     {
         return null;
     }
     
     X509Certificate2Collection x509Collection = new X509Certificate2Collection();
     if (anchors != null)
     {
         for (int i = 0; i < anchors.Length; ++i)
         {
             x509Collection.Add(anchors[i].ToX509Certificate());
         }
     }            
     return x509Collection;
 }