Exemple #1
0
 public Anchor Add(Anchor anchor)
 {
     using (ConfigDatabase db = this.Store.CreateContext())
     {
         this.Add(db, anchor);
         db.SubmitChanges();
         return anchor;
     }
 }
Exemple #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);
 }
        Anchor ApplyGetOptions(Anchor anchor, CertificateGetOptions options)
        {
            if (options == null)
            {
                options = CertificateGetOptions.Default;
            }

            return options.ApplyTo(anchor);
        }
        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();
        }
 public void AddAnchors(Anchor[] anchors)
 {
     try
     {
         Store.Anchors.Add(anchors);
     }
     catch (Exception ex)
     {
         throw CreateFault("AddAnchors", ex);
     }
 }
 public Anchor AddAnchor(Anchor anchor)
 {
     try
     {
         return Store.Anchors.Add(anchor);
     }
     catch (Exception ex)
     {
         throw CreateFault("AddAnchors", ex);
     }
 }
Exemple #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;
            }
Exemple #8
0
 public Anchor Update(Anchor anchor)
 {
     throw new NotSupportedException("Updating anchors not supported");
 }
Exemple #9
0
 public Anchor ChangeStatus(Anchor anchor, EntityStatus status)
 {
     Client.SetAnchorStatus(new[] { anchor.ID }, status);
     anchor.Status = status;
     return anchor;
 }
Exemple #10
0
 public void Delete(Anchor anchor)
 {
     Client.RemoveAnchors(new[] {anchor.ID});
 }
Exemple #11
0
 public Anchor Add(Anchor anchor)
 {
     return Client.AddAnchor(anchor);
 }
        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;
        }
Exemple #13
0
 public static void AddAnchor(this AnchorStoreClient client, Anchor anchor)
 {
     client.AddAnchors(new Anchor[] {anchor});
 }
Exemple #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;
 }