1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
12 using System.Reflection;
17 public class ItemFactory : global::System.IDisposable {
18 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19 protected bool swigCMemOwn;
21 internal ItemFactory(global::System.IntPtr cPtr, bool cMemoryOwn) {
22 swigCMemOwn = cMemoryOwn;
23 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
26 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ItemFactory obj) {
27 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
31 DisposeQueue.Instance.Add(this);
34 public virtual void Dispose() {
35 if (!Stage.IsInstalled()) {
36 DisposeQueue.Instance.Add(this);
41 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
44 NDalicPINVOKE.delete_ItemFactory(swigCPtr);
46 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
48 global::System.GC.SuppressFinalize(this);
53 public virtual uint GetNumberOfItems() {
54 uint ret = NDalicPINVOKE.ItemFactory_GetNumberOfItems(swigCPtr);
55 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59 public virtual Actor NewItem(uint itemId) {
60 Actor ret = new Actor(NDalicPINVOKE.ItemFactory_NewItem(swigCPtr, itemId), true);
61 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65 public virtual void ItemReleased(uint itemId, Actor actor) {
66 if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2)) NDalicPINVOKE.ItemFactory_ItemReleasedSwigExplicitItemFactory(swigCPtr, itemId, Actor.getCPtr(actor)); else NDalicPINVOKE.ItemFactory_ItemReleased(swigCPtr, itemId, Actor.getCPtr(actor));
67 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 public ItemFactory() : this(NDalicPINVOKE.new_ItemFactory(), true) {
71 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72 SwigDirectorConnect();
75 private void SwigDirectorConnect() {
76 if (SwigDerivedClassHasMethod("GetNumberOfItems", swigMethodTypes0))
77 swigDelegate0 = new SwigDelegateItemFactory_0(SwigDirectorGetNumberOfItems);
78 if (SwigDerivedClassHasMethod("NewItem", swigMethodTypes1))
79 swigDelegate1 = new SwigDelegateItemFactory_1(SwigDirectorNewItem);
80 if (SwigDerivedClassHasMethod("ItemReleased", swigMethodTypes2))
81 swigDelegate2 = new SwigDelegateItemFactory_2(SwigDirectorItemReleased);
82 NDalicPINVOKE.ItemFactory_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2);
88 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)
\r
90 global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, methodTypes);
\r
91 bool hasDerivedMethod = methodInfo.GetType().GetTypeInfo().IsSubclassOf(typeof(ItemFactory));
\r
92 return hasDerivedMethod;
\r
96 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
97 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);
98 bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(ItemFactory));
99 return hasDerivedMethod;
104 private uint SwigDirectorGetNumberOfItems() {
105 return GetNumberOfItems();
108 private global::System.IntPtr SwigDirectorNewItem(uint itemId) {
109 return Actor.getCPtr(NewItem(itemId)).Handle;
112 private void SwigDirectorItemReleased(uint itemId, global::System.IntPtr actor) {
113 ItemReleased(itemId, new Actor(actor, true));
116 public delegate uint SwigDelegateItemFactory_0();
117 public delegate global::System.IntPtr SwigDelegateItemFactory_1(uint itemId);
118 public delegate void SwigDelegateItemFactory_2(uint itemId, global::System.IntPtr actor);
120 private SwigDelegateItemFactory_0 swigDelegate0;
121 private SwigDelegateItemFactory_1 swigDelegate1;
122 private SwigDelegateItemFactory_2 swigDelegate2;
124 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
125 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(uint) };
126 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { typeof(uint), typeof(Actor) };