1 //------------------------------------------------------------------------------
2 // <auto-generated />
3 //
4 // This file was automatically generated by SWIG (http://www.swig.org).
5 // Version 3.0.13
6 //
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
10 
11 namespace Xapian {
12 
13 public class KeyMaker : global::System.IDisposable {
14   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
15   protected bool swigCMemOwn;
16 
KeyMaker(global::System.IntPtr cPtr, bool cMemoryOwn)17   internal KeyMaker(global::System.IntPtr cPtr, bool cMemoryOwn) {
18     swigCMemOwn = cMemoryOwn;
19     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
20   }
21 
getCPtr(KeyMaker obj)22   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyMaker obj) {
23     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
24   }
25 
~KeyMaker()26   ~KeyMaker() {
27     Dispose();
28   }
29 
Dispose()30   public virtual void Dispose() {
31     lock(this) {
32       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
33         if (swigCMemOwn) {
34           swigCMemOwn = false;
35           XapianPINVOKE.delete_KeyMaker(swigCPtr);
36         }
37         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
38       }
39       global::System.GC.SuppressFinalize(this);
40     }
41   }
42 
KeyMaker()43   public KeyMaker() : this(XapianPINVOKE.new_KeyMaker(), true) {
44     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
45     SwigDirectorConnect();
46   }
47 
Apply(Document doc)48   public virtual string Apply(Document doc) {
49     string ret = XapianPINVOKE.KeyMaker_Apply(swigCPtr, Document.getCPtr(doc));
50     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
51     return ret;
52   }
53 
Release()54   public KeyMaker Release() {
55     global::System.IntPtr cPtr = XapianPINVOKE.KeyMaker_Release(swigCPtr);
56     KeyMaker ret = (cPtr == global::System.IntPtr.Zero) ? null : new KeyMaker(cPtr, false);
57     if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
58     return ret;
59   }
60 
SwigDirectorConnect()61   private void SwigDirectorConnect() {
62     if (SwigDerivedClassHasMethod("Apply", swigMethodTypes0))
63       swigDelegate0 = new SwigDelegateKeyMaker_0(SwigDirectorApply);
64     XapianPINVOKE.KeyMaker_director_connect(swigCPtr, swigDelegate0);
65   }
66 
SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)67   private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
68     global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
69     bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(KeyMaker));
70     return hasDerivedMethod;
71   }
72 
SwigDirectorApply(global::System.IntPtr doc)73   private string SwigDirectorApply(global::System.IntPtr doc) {
74     return Apply(new Document(doc, false));
75   }
76 
SwigDelegateKeyMaker_0(global::System.IntPtr doc)77   public delegate string SwigDelegateKeyMaker_0(global::System.IntPtr doc);
78 
79   private SwigDelegateKeyMaker_0 swigDelegate0;
80 
81   private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(Document) };
82 }
83 
84 }
85