Пример #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        public static IntPtr Box(object val)
        {
            BoxDelegate boxFunction;

            if (_boxFunctions.TryGetValue(val.GetType(), out boxFunction))
            {
                return(RegisterPendingRelease(boxFunction(val)));
            }
            else if (val.GetType().GetTypeInfo().IsEnum)
            {
                _boxFunctions.TryGetValue(typeof(int), out boxFunction);
                return(RegisterPendingRelease(boxFunction((int)Convert.ToInt64(val))));
            }
            else if (val is Type)
            {
                ResourceKeyType resourceKey = GetResourceKeyType((Type)val);
                HandleRef       handle      = BaseComponent.getCPtr(resourceKey);
                BaseComponent.AddReference(handle.Handle);
                return(RegisterPendingRelease(handle.Handle));
            }
            else
            {
                return(IntPtr.Zero);
            }
        }
Пример #2
0
 internal static HandleRef getCPtr(ResourceKeyType obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Пример #3
0
        private static Dictionary <Type, GetDelegate> CreateGetFunctions()
        {
            Dictionary <Type, GetDelegate> getFunctions = new Dictionary <Type, GetDelegate>(50);

            getFunctions[typeof(bool)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return(Noesis_DependencyGet_Bool(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(float)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return(Noesis_DependencyGet_Float(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(double)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return(Noesis_DependencyGet_Double(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(decimal)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return((decimal)Noesis_DependencyGet_Double(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(int)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return(Noesis_DependencyGet_Int(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(long)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return((long)Noesis_DependencyGet_Int(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(uint)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return(Noesis_DependencyGet_UInt(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(ulong)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return((ulong)Noesis_DependencyGet_UInt(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(char)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return((char)Noesis_DependencyGet_UInt(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(short)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return(Noesis_DependencyGet_Short(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(sbyte)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return((sbyte)Noesis_DependencyGet_Short(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(ushort)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return(Noesis_DependencyGet_UShort(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(byte)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                return((byte)Noesis_DependencyGet_UShort(cPtr, dp, false, out isNull));
            };
            getFunctions[typeof(string)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                IntPtr ptr = Noesis_DependencyGet_String(cPtr, dp);
                return(Noesis.Extend.StringFromNativeUtf8(ptr));
            };
            getFunctions[typeof(System.Uri)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                IntPtr ptr = Noesis_DependencyGet_Uri(cPtr, dp);
                string uri = Noesis.Extend.StringFromNativeUtf8(ptr);
                return(new Uri(uri, UriKind.Relative));
            };
            getFunctions[typeof(Noesis.Color)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Color(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.Color>(ptr));
            };
            getFunctions[typeof(Noesis.Point)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Point(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.Point>(ptr));
            };
            getFunctions[typeof(Noesis.Rect)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Rect(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.Rect>(ptr));
            };
            getFunctions[typeof(Noesis.Size)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Size(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.Size>(ptr));
            };
            getFunctions[typeof(Noesis.Thickness)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Thickness(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.Thickness>(ptr));
            };
            getFunctions[typeof(Noesis.CornerRadius)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_CornerRadius(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.CornerRadius>(ptr));
            };
            getFunctions[typeof(TimeSpan)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_TimeSpan(cPtr, dp, false, out isNull);
                return((TimeSpan)Marshal.PtrToStructure <Noesis.TimeSpanStruct>(ptr));
            };
            getFunctions[typeof(Noesis.Duration)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Duration(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.Duration>(ptr));
            };
            getFunctions[typeof(Noesis.KeyTime)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_KeyTime(cPtr, dp, false, out isNull);
                return(Marshal.PtrToStructure <Noesis.KeyTime>(ptr));
            };

            getFunctions[typeof(bool?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                bool val = Noesis_DependencyGet_Bool(cPtr, dp, true, out isNull);
                return(isNull ? null : (bool?)val);
            };
            getFunctions[typeof(float?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool  isNull;
                float val = Noesis_DependencyGet_Float(cPtr, dp, true, out isNull);
                return(isNull ? null : (float?)val);
            };
            getFunctions[typeof(double?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                double val = Noesis_DependencyGet_Double(cPtr, dp, true, out isNull);
                return(isNull ? null : (double?)val);
            };
            getFunctions[typeof(decimal?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                double val = Noesis_DependencyGet_Double(cPtr, dp, true, out isNull);
                return(isNull ? null : (decimal?)(decimal)val);
            };
            getFunctions[typeof(int?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                int  val = Noesis_DependencyGet_Int(cPtr, dp, true, out isNull);
                return(isNull ? null : (int?)val);
            };
            getFunctions[typeof(long?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                int  val = Noesis_DependencyGet_Int(cPtr, dp, true, out isNull);
                return(isNull ? null : (long?)(long)val);
            };
            getFunctions[typeof(uint?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                uint val = Noesis_DependencyGet_UInt(cPtr, dp, true, out isNull);
                return(isNull ? null : (uint?)val);
            };
            getFunctions[typeof(ulong?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                uint val = Noesis_DependencyGet_UInt(cPtr, dp, true, out isNull);
                return(isNull ? null : (ulong?)(ulong)val);
            };
            getFunctions[typeof(char?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool isNull;
                uint val = Noesis_DependencyGet_UInt(cPtr, dp, true, out isNull);
                return(isNull ? null : (char?)(char)val);
            };
            getFunctions[typeof(short?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool  isNull;
                short val = Noesis_DependencyGet_Short(cPtr, dp, true, out isNull);
                return(isNull ? null : (short?)val);
            };
            getFunctions[typeof(sbyte?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool  isNull;
                short val = Noesis_DependencyGet_Short(cPtr, dp, true, out isNull);
                return(isNull ? null : (sbyte?)(sbyte)val);
            };
            getFunctions[typeof(ushort?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                ushort val = Noesis_DependencyGet_UShort(cPtr, dp, true, out isNull);
                return(isNull ? null : (ushort?)val);
            };
            getFunctions[typeof(byte?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                ushort val = Noesis_DependencyGet_UShort(cPtr, dp, true, out isNull);
                return(isNull ? null : (byte?)(byte)val);
            };
            getFunctions[typeof(Noesis.Color?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Color(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.Color?)Marshal.PtrToStructure <Noesis.Color>(ptr));
            };
            getFunctions[typeof(Noesis.Point?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Point(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.Point?)Marshal.PtrToStructure <Noesis.Point>(ptr));
            };
            getFunctions[typeof(Noesis.Rect?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Rect(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.Rect?)Marshal.PtrToStructure <Noesis.Rect>(ptr));
            };
            getFunctions[typeof(Noesis.Size?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Size(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.Size?)Marshal.PtrToStructure <Noesis.Size>(ptr));
            };
            getFunctions[typeof(Noesis.Thickness?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Thickness(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.Thickness?)Marshal.PtrToStructure <Noesis.Thickness>(ptr));
            };
            getFunctions[typeof(Noesis.CornerRadius?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_CornerRadius(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.CornerRadius?)Marshal.PtrToStructure <Noesis.CornerRadius>(ptr));
            };
            getFunctions[typeof(TimeSpan?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_TimeSpan(cPtr, dp, true, out isNull);
                return(isNull ? null : (TimeSpan?)(TimeSpan)Marshal.PtrToStructure <Noesis.TimeSpanStruct>(ptr));
            };
            getFunctions[typeof(Noesis.Duration?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_Duration(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.Duration?)Marshal.PtrToStructure <Noesis.Duration>(ptr));
            };
            getFunctions[typeof(Noesis.KeyTime?)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                bool   isNull;
                IntPtr ptr = Noesis_DependencyGet_KeyTime(cPtr, dp, true, out isNull);
                return(isNull ? null : (Noesis.KeyTime?)Marshal.PtrToStructure <Noesis.KeyTime>(ptr));
            };
            getFunctions[typeof(Type)] = (cPtr, dp) =>
            {
                CheckProperty(cPtr, dp, "get");
                IntPtr ptr = Noesis_DependencyGet_BaseComponent(cPtr, dp);
                if (ptr != IntPtr.Zero)
                {
                    ResourceKeyType key = new ResourceKeyType(ptr, false);
                    return(key.Type);
                }
                else
                {
                    return(null);
                }
            };

            return(getFunctions);
        }
Пример #4
0
        private static Dictionary <Type, SetDelegate> CreateSetFunctions()
        {
            Dictionary <Type, SetDelegate> setFunctions = new Dictionary <Type, SetDelegate>(50);

            setFunctions[typeof(bool)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Bool(cPtr, dp, (bool)value, false, false);
            };
            setFunctions[typeof(float)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Float(cPtr, dp, (float)value, false, false);
            };
            setFunctions[typeof(double)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Double(cPtr, dp, (double)value, false, false);
            };
            setFunctions[typeof(decimal)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Double(cPtr, dp, (double)(decimal)value, false, false);
            };
            setFunctions[typeof(int)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Int(cPtr, dp, (int)value, false, false);
            };
            setFunctions[typeof(long)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Int(cPtr, dp, (int)(long)value, false, false);
            };
            setFunctions[typeof(uint)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_UInt(cPtr, dp, (uint)value, false, false);
            };
            setFunctions[typeof(ulong)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_UInt(cPtr, dp, (uint)(ulong)value, false, false);
            };
            setFunctions[typeof(char)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_UInt(cPtr, dp, (uint)(char)value, false, false);
            };
            setFunctions[typeof(short)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Short(cPtr, dp, (short)value, false, false);
            };
            setFunctions[typeof(sbyte)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Short(cPtr, dp, (short)(sbyte)value, false, false);
            };
            setFunctions[typeof(ushort)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_UShort(cPtr, dp, (ushort)value, false, false);
            };
            setFunctions[typeof(byte)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_UShort(cPtr, dp, (ushort)(byte)value, false, false);
            };
            setFunctions[typeof(string)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_String(cPtr, dp, value == null ? string.Empty : value.ToString());
            };
            setFunctions[typeof(System.Uri)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis_DependencySet_Uri(cPtr, dp, value == null ? string.Empty : ((Uri)value).OriginalString);
            };
            setFunctions[typeof(Noesis.Color)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.Color value_ = (Noesis.Color)value;
                Noesis_DependencySet_Color(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(Noesis.Point)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.Point value_ = (Noesis.Point)value;
                Noesis_DependencySet_Point(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(Noesis.Rect)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.Rect value_ = (Noesis.Rect)value;
                Noesis_DependencySet_Rect(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(Noesis.Size)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.Size value_ = (Noesis.Size)value;
                Noesis_DependencySet_Size(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(Noesis.Thickness)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.Thickness value_ = (Noesis.Thickness)value;
                Noesis_DependencySet_Thickness(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(Noesis.CornerRadius)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.CornerRadius value_ = (Noesis.CornerRadius)value;
                Noesis_DependencySet_CornerRadius(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(TimeSpan)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.TimeSpanStruct value_ = (Noesis.TimeSpanStruct)((TimeSpan)value);
                Noesis_DependencySet_TimeSpan(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(Noesis.Duration)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.Duration value_ = (Noesis.Duration)value;
                Noesis_DependencySet_Duration(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(Noesis.KeyTime)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                Noesis.KeyTime value_ = (Noesis.KeyTime)value;
                Noesis_DependencySet_KeyTime(cPtr, dp, ref value_, false, false);
            };
            setFunctions[typeof(bool?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Bool(cPtr, dp, default(bool), true, true);
                }
                else
                {
                    Noesis_DependencySet_Bool(cPtr, dp, (bool)value, true, false);
                }
            };
            setFunctions[typeof(float?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Float(cPtr, dp, default(float), true, true);
                }
                else
                {
                    Noesis_DependencySet_Float(cPtr, dp, (float)value, true, false);
                }
            };
            setFunctions[typeof(double?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Double(cPtr, dp, default(double), true, true);
                }
                else
                {
                    Noesis_DependencySet_Double(cPtr, dp, (double)value, true, false);
                }
            };
            setFunctions[typeof(decimal?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Double(cPtr, dp, default(double), true, true);
                }
                else
                {
                    Noesis_DependencySet_Double(cPtr, dp, (double)(decimal)value, true, false);
                }
            };
            setFunctions[typeof(int?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Int(cPtr, dp, default(int), true, true);
                }
                else
                {
                    Noesis_DependencySet_Int(cPtr, dp, (int)value, true, false);
                }
            };
            setFunctions[typeof(long?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Int(cPtr, dp, default(int), true, true);
                }
                else
                {
                    Noesis_DependencySet_Int(cPtr, dp, (int)(long)value, true, false);
                }
            };
            setFunctions[typeof(uint?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_UInt(cPtr, dp, default(uint), true, true);
                }
                else
                {
                    Noesis_DependencySet_UInt(cPtr, dp, (uint)value, true, false);
                }
            };
            setFunctions[typeof(ulong?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_UInt(cPtr, dp, default(uint), true, true);
                }
                else
                {
                    Noesis_DependencySet_UInt(cPtr, dp, (uint)(ulong)value, true, false);
                }
            };
            setFunctions[typeof(char?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_UInt(cPtr, dp, default(uint), true, true);
                }
                else
                {
                    Noesis_DependencySet_UInt(cPtr, dp, (uint)(char)value, true, false);
                }
            };
            setFunctions[typeof(short?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Short(cPtr, dp, default(short), true, true);
                }
                else
                {
                    Noesis_DependencySet_Short(cPtr, dp, (short)value, true, false);
                }
            };
            setFunctions[typeof(sbyte?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_Short(cPtr, dp, default(short), true, true);
                }
                else
                {
                    Noesis_DependencySet_Short(cPtr, dp, (short)(sbyte)value, true, false);
                }
            };
            setFunctions[typeof(ushort?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_UShort(cPtr, dp, default(ushort), true, true);
                }
                else
                {
                    Noesis_DependencySet_UShort(cPtr, dp, (ushort)value, true, false);
                }
            };
            setFunctions[typeof(byte?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis_DependencySet_UShort(cPtr, dp, default(ushort), true, true);
                }
                else
                {
                    Noesis_DependencySet_UShort(cPtr, dp, (ushort)(byte)value, true, false);
                }
            };
            setFunctions[typeof(Noesis.Color?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.Color value_ = default(Noesis.Color);
                    Noesis_DependencySet_Color(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.Color value_ = (Noesis.Color)value;
                    Noesis_DependencySet_Color(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Noesis.Point?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.Point value_ = default(Noesis.Point);
                    Noesis_DependencySet_Point(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.Point value_ = (Noesis.Point)value;
                    Noesis_DependencySet_Point(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Noesis.Rect?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.Rect value_ = default(Noesis.Rect);
                    Noesis_DependencySet_Rect(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.Rect value_ = (Noesis.Rect)value;
                    Noesis_DependencySet_Rect(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Noesis.Size?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.Size value_ = default(Noesis.Size);
                    Noesis_DependencySet_Size(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.Size value_ = (Noesis.Size)value;
                    Noesis_DependencySet_Size(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Noesis.Thickness?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.Thickness value_ = default(Noesis.Thickness);
                    Noesis_DependencySet_Thickness(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.Thickness value_ = (Noesis.Thickness)value;
                    Noesis_DependencySet_Thickness(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Noesis.CornerRadius?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.CornerRadius value_ = default(Noesis.CornerRadius);
                    Noesis_DependencySet_CornerRadius(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.CornerRadius value_ = (Noesis.CornerRadius)value;
                    Noesis_DependencySet_CornerRadius(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(TimeSpan?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.TimeSpanStruct value_ = default(Noesis.TimeSpanStruct);
                    Noesis_DependencySet_TimeSpan(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.TimeSpanStruct value_ = (Noesis.TimeSpanStruct)((TimeSpan)value);
                    Noesis_DependencySet_TimeSpan(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Noesis.Duration?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.Duration value_ = default(Noesis.Duration);
                    Noesis_DependencySet_Duration(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.Duration value_ = (Noesis.Duration)value;
                    Noesis_DependencySet_Duration(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Noesis.KeyTime?)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                if (value == null)
                {
                    Noesis.KeyTime value_ = default(Noesis.KeyTime);
                    Noesis_DependencySet_KeyTime(cPtr, dp, ref value_, true, true);
                }
                else
                {
                    Noesis.KeyTime value_ = (Noesis.KeyTime)value;
                    Noesis_DependencySet_KeyTime(cPtr, dp, ref value_, true, false);
                }
            };
            setFunctions[typeof(Type)] = (cPtr, dp, value) =>
            {
                CheckProperty(cPtr, dp, "set");
                ResourceKeyType key = Noesis.Extend.GetResourceKeyType((Type)value);
                Noesis_DependencySet_BaseComponent(cPtr, dp, Noesis.Extend.GetInstanceHandle(key).Handle);
            };

            return(setFunctions);
        }