Example #1
0
 private static void OnPlaySound(IntPtr sound, float volume)
 {
     try
     {
         if (_initialized)
         {
             _playSoundCallback(Extend.StringFromNativeUtf8(sound), volume);
         }
     }
     catch (Exception e)
     {
         Error.UnhandledException(e);
     }
 }
Example #2
0
 private static void OnOpenUrl(IntPtr url)
 {
     try
     {
         if (_initialized)
         {
             _openUrlCallback(Extend.StringFromNativeUtf8(url));
         }
     }
     catch (Exception e)
     {
         Error.UnhandledException(e);
     }
 }
Example #3
0
 private static void OnXamlDependency(int callbackId, IntPtr uri, int type)
 {
     try
     {
         if (_initialized)
         {
             Deps deps = _depsCallbacks[callbackId];
             deps.Callback(Extend.StringFromNativeUtf8(uri), (XamlDependencyType)type);
         }
     }
     catch (Exception e)
     {
         Error.UnhandledException(e);
     }
 }
Example #4
0
 private static void OnPlayAudio(IntPtr sound, float volume)
 {
     try
     {
         if (_initialized)
         {
             string uriStr = Extend.StringFromNativeUtf8(sound);
             _playAudioCallback(new Uri(uriStr, UriKind.RelativeOrAbsolute), volume);
         }
     }
     catch (Exception e)
     {
         Error.UnhandledException(e);
     }
 }
Example #5
0
 private static void OnXamlDependency(int callbackId, IntPtr uri, int type)
 {
     try
     {
         if (_initialized)
         {
             Deps   deps   = _depsCallbacks[callbackId];
             string uriStr = Extend.StringFromNativeUtf8(uri);
             deps.Callback(new Uri(uriStr, UriKind.RelativeOrAbsolute), (XamlDependencyType)type);
         }
     }
     catch (Exception e)
     {
         Error.UnhandledException(e);
     }
 }
Example #6
0
 private static void OnFontFace(int callbackId, int index, IntPtr familyName,
                                int weight, int style, int stretch)
 {
     try
     {
         if (_initialized)
         {
             Faces faces = _facesCallbacks[callbackId];
             faces.Callback(index, Extend.StringFromNativeUtf8(familyName),
                            (FontWeight)weight, (FontStyle)style, (FontStretch)stretch);
         }
     }
     catch (Exception e)
     {
         Error.UnhandledException(e);
     }
 }
Example #7
0
        /// <summary>
        /// Returns the build version, for example "1.2.6f5".
        /// </summary>
        public static string GetBuildVersion()
        {
            IntPtr version = Noesis_GetBuildVersion();

            return(Extend.StringFromNativeUtf8(version));
        }
        string IXamlNamespaceResolver.GetNamespace(string prefix)
        {
            IntPtr strPtr = MarkupExtensionProvider_GetNamespace(_provider, prefix);

            return(Extend.StringFromNativeUtf8(strPtr));
        }