コード例 #1
0
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
 /// <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
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
 /// <summary>
 /// Sets TextureProvider to load texture resources.
 /// </summary>
 public static void SetTextureProvider(TextureProvider provider)
 {
     Noesis_SetTextureProvider(Extend.GetInstanceHandle(provider));
 }
コード例 #4
0
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
 /// <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
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
        /// <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
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
        /// <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
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
        /// <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
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
        /// <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));
        }
コード例 #18
0
        /// <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
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
 /// <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);
 }
コード例 #20
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 xaml)
 {
     Noesis_LoadComponent_(Extend.GetInstanceHandle(component), xaml);
 }
コード例 #21
0
ファイル: NoesisGUI.cs プロジェクト: Hengle/Managed
 /// <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();
 }
コード例 #22
0
 /// <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);
 }