Пример #1
0
 internal static XmlUpdateContext ToInternal(UpdateContext v)
 {
     if (v == null)
     {
         return null;
     }
     return v.Internal;
 }
Пример #2
0
 public int Execute(Transaction txn, Value toModify, QueryContext context, UpdateContext uc)
 {
     return (int) this.mod_.execute(Transaction.ToInternal(txn), Value.ToInternal(toModify), QueryContext.ToInternal(context), UpdateContext.ToInternal(uc));
 }
Пример #3
0
 public void UpgradeContainer(string name, UpdateContext uc)
 {
     this.mgr_.upgradeContainer(name, UpdateContext.ToInternal(uc));
 }
Пример #4
0
 public void LoadContainer(string name, string filename, UpdateContext uc)
 {
     this.mgr_.loadContainer(name, filename, UpdateContext.ToInternal(uc));
 }
Пример #5
0
 public void DeleteDocument(Transaction txn, Document document, UpdateContext context)
 {
     this.cont_.deleteDocument(Transaction.ToInternal(txn), Document.ToInternal(document), UpdateContext.ToInternal(context));
 }
Пример #6
0
 public void DeleteDocument(Transaction txn, string name, UpdateContext context)
 {
     this.cont_.deleteDocument(Transaction.ToInternal(txn), name, UpdateContext.ToInternal(context));
 }
Пример #7
0
 public void AddIndex(Transaction txn, IndexSpecification.Entry entry, UpdateContext uc)
 {
     this.cont_.addIndex(Transaction.ToInternal(txn), entry.URI, entry.Name, entry.Index, UpdateContext.ToInternal(uc));
 }
Пример #8
0
 public void DeleteDefaultIndex(Transaction txn, string index, UpdateContext uc)
 {
     this.cont_.deleteDefaultIndex(Transaction.ToInternal(txn), index, UpdateContext.ToInternal(uc));
 }
Пример #9
0
 public void SetIndexSpecification(Transaction txn, IndexSpecification index, UpdateContext uc)
 {
     this.cont_.setIndexSpecification(Transaction.ToInternal(txn), index.Internal, UpdateContext.ToInternal(uc));
 }
Пример #10
0
 public string PutDocument(Transaction txn, string name, string contents, UpdateContext context, DocumentConfig config)
 {
     return this.cont_.putDocument(Transaction.ToInternal(txn), name, contents, UpdateContext.ToInternal(context), config.Flags);
 }
Пример #11
0
 public string PutDocument(Transaction txn, string name, InputStream input, UpdateContext context, DocumentConfig config)
 {
     using (input)
     {
         input.Internal.disownCPtr();
         return this.cont_.putDocument(Transaction.ToInternal(txn), name, input.Internal, UpdateContext.ToInternal(context), config.Flags);
     }
 }
Пример #12
0
 public void PutDocument(Transaction txn, Document document, UpdateContext context, DocumentConfig config)
 {
     this.cont_.putDocument(Transaction.ToInternal(txn), Document.ToInternal(document), UpdateContext.ToInternal(context), config.Flags);
 }
Пример #13
0
    private static void addIndex(Container container, string uri, string name,
		string index, Transaction txn, UpdateContext uc )
    {
        System.Console.WriteLine("Adding index type '" + index +
            "' to node '" + name + "'.");

        // Retrieve the index specification from the container
        using(IndexSpecification idxSpec = container.GetIndexSpecification(txn))
        {

            // See what indexes exist on the container
            int count = 0;
            System.Console.WriteLine("Before index add.");
            while(idxSpec.MoveNext())
            {
                System.Console.WriteLine("\tFor node '" + idxSpec.Current.Name +
                    "', found index: '" + idxSpec.Current.Index +
                    "'.");
                ++count;
            }

            System.Console.WriteLine(count + " indexes found.");

            // Add the index to the specification.
            // If it already exists, then this does nothing.
            idxSpec.AddIndex(new IndexSpecification.Entry(uri, name, index));

            // Set the specification back to the container
            container.SetIndexSpecification(txn, idxSpec, uc);
        }

        // Retrieve the index specification from the container
        using(IndexSpecification idxSpec = container.GetIndexSpecification(txn))
        {

            // Look at the indexes again to make sure our replacement took.
            int count = 0;
            System.Console.WriteLine("After index add.");
            while(idxSpec.MoveNext())
            {
                System.Console.WriteLine("\tFor node '" + idxSpec.Current.Name +
                    "', found index: '" + idxSpec.Current.Index +
                    "'.");
                ++count;
            }

            System.Console.WriteLine(count + " indexes found.");
        }
    }