示例#1
0
 /// <summary>
 /// Sets a collection of application-scope resources, such as styles and brushes. Provides a
 /// simple way to support a consistent theme across your application.
 /// </summary>
 /// <param name="resources">Application resources.</param>
 public static void SetApplicationResources(ResourceDictionary resources)
 {
     Noesis_SetApplicationResources(Extend.GetInstanceHandle(resources));
 }
示例#2
0
        /// <summary>
        /// Loads a XAML resource from a Stream.
        /// </summary>
        /// <param name="stream">Stream with xaml contents.</param>
        /// <param name="filename">Path to the resource.</param>
        /// <returns>Root of the loaded XAML.</returns>
        public static object LoadXaml(Stream stream, string filename)
        {
            IntPtr root = Noesis_LoadStreamXaml(Extend.GetInstanceHandle(stream), filename ?? string.Empty);

            return(Extend.GetProxy(root, true));
        }
示例#3
0
 /// <summary>
 /// Sets TextureProvider to load texture resources.
 /// </summary>
 public static void SetTextureProvider(TextureProvider provider)
 {
     Noesis_SetTextureProvider(Extend.GetInstanceHandle(provider));
 }
示例#4
0
 /// <summary>
 /// Sets XamlProvider to load XAML resources.
 /// </summary>
 public static void SetXamlProvider(XamlProvider provider)
 {
     Noesis_SetXamlProvider(Extend.GetInstanceHandle(provider));
 }
示例#5
0
 /// <summary>
 /// Sets Theme resources.
 /// </summary>
 /// <param name="theme">Dictionary with default styles for all controls.</param>
 public static void SetTheme(ResourceDictionary theme)
 {
     Noesis_SetTheme_(Extend.GetInstanceHandle(theme));
 }
示例#6
0
        /// <summary>
        /// Loads a XAML resource, like an audio, at the given uniform resource identifier.
        /// </summary>
        public static Stream LoadXamlResource(string filename)
        {
            IntPtr stream = Noesis_LoadXamlResource(filename);

            return((Stream)Extend.GetProxy(stream, true));
        }
示例#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));
        }
示例#8
0
 public static void UnregisterCallbacks()
 {
     Extend.UnregisterCallbacks();
 }
示例#9
0
 public static void RegisterNativeTypes()
 {
     Extend.RegisterNativeTypes();
 }
示例#10
0
 public static void UnregisterFunctions()
 {
     Extend.UnregisterFunctions();
 }
示例#11
0
 public static void RegisterCallbacks()
 {
     Extend.RegisterCallbacks();
 }
示例#12
0
 public static void RegisterFunctions(Library lib)
 {
     Extend.RegisterFunctions(lib);
 }
示例#13
0
        object IXamlNameResolver.Resolve(string name)
        {
            IntPtr objectPtr = MarkupExtensionProvider_ResolveName(_provider, name);

            return(Extend.GetProxy(objectPtr, false));
        }
示例#14
0
        string IXamlNamespaceResolver.GetNamespace(string prefix)
        {
            IntPtr strPtr = MarkupExtensionProvider_GetNamespace(_provider, prefix);

            return(Extend.StringFromNativeUtf8(strPtr));
        }
示例#15
0
        /// <summary>
        /// Loads a XAML resource.
        /// </summary>
        /// <param name="filename">Path to the resource.</param>
        /// <returns>Root of the loaded XAML.</returns>
        public static object LoadXaml(string filename)
        {
            IntPtr root = Noesis_LoadXaml(filename);

            return(Extend.GetProxy(root, true));
        }
示例#16
0
 public static void ResetDependencyProperties()
 {
     Extend.ResetDependencyProperties();
 }
示例#17
0
        /// <summary>
        /// Parses a well-formed XAML fragment and creates the corresponding object tree.
        /// </summary>
        public static object ParseXaml(string xamlText)
        {
            IntPtr root = Noesis_ParseXaml(xamlText);

            return(Extend.GetProxy(root, true));
        }
        /// <summary>
        /// Loads a XAML resource.
        /// </summary>
        /// <param name="xaml">Path to the resource.</param>
        /// <returns>Root of the loaded XAML.</returns>
        public static object LoadXaml(string xaml)
        {
            IntPtr root = Noesis_LoadXaml_(xaml);

            return(Extend.GetProxy(root, true));
        }
示例#19
0
 /// <summary>
 /// Loads contents of the specified component from a XAML.
 /// Used from InitializeComponent; supplied component must match the type of the XAML root
 /// </summary>
 public static void LoadComponent(object component, string filename)
 {
     Noesis_LoadComponent(Extend.GetInstanceHandle(component), filename);
 }
 /// <summary>
 /// Loads contents of the specified component from a XAML.
 /// Used from InitializeComponent; supplied component must match the type of the XAML root
 /// </summary>
 public static void LoadComponent(object component, string xaml)
 {
     Noesis_LoadComponent_(Extend.GetInstanceHandle(component), xaml);
 }
示例#21
0
 /// <summary>
 /// Unregisters the native types generated for managed extend classes, so they can be
 /// modified and updated without unloading NoesisGUI.
 /// </summary>
 public static void UnregisterNativeTypes()
 {
     Extend.UnregisterNativeTypes();
 }
 /// <summary>
 /// Sets FontProvider to load font resources.
 /// </summary>
 public static void SetFontProvider(FontProvider provider)
 {
     Noesis_SetFontProvider_(Extend.GetInstanceHandle(provider));
 }
示例#23
0
        private static RoutedEvent AddRoutedEvent(string name, RoutingStrategy routingStrategy,
                                                  Type handlerType, Type ownerType)
        {
            IntPtr routedEventPtr = Noesis_EventManager_RegisterRoutedEvent(name,
                                                                            (int)routingStrategy, Extend.GetNativeType(ownerType));

            RoutedEvent routedEvent = (RoutedEvent)Extend.GetProxy(routedEventPtr, false);

            RegisterRoutedEvent(routedEvent, handlerType, GetInvoker(handlerType));

            return(routedEvent);
        }
示例#24
0
 /// <summary>
 /// Performs a layout pass and sends updates to the render tree.
 /// </summary>
 /// <param name="timeInSeconds">Time elapsed since the start of the application.</param>
 public void Update(double timeInSeconds)
 {
     Extend.Update();
     GUI.SoftwareKeyboard.Update();
     Noesis_View_Update_(CPtr, timeInSeconds);
 }