using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
+using System.Reflection;
using System.Runtime.InteropServices;
using Tizen.Applications;
internal string ResourceClassName { get; set; }
+ internal Assembly Assembly { get; set; }
+
internal static NUIGadgetInfo CreateNUIGadgetInfo(string packageId)
{
Interop.PackageManagerInfo.ErrorCode errorCode = Interop.PackageManagerInfo.PackageInfoGet(packageId, out IntPtr handle);
throw new ArgumentException("Failed to find NUIGadgetInfo. resource type: " + resourceType);
}
- Assembly assembly = null;
try
{
- Log.Warn("NUIGadgetAssembly.Load(): " + info.ResourcePath + info.ExecutableFile + " ++");
- assembly = Assembly.Load(File.ReadAllBytes(info.ResourcePath + info.ExecutableFile));
- Log.Warn("NUIGadgetAssembly.Load(): " + info.ResourcePath + info.ExecutableFile + " --");
+ if (info.Assembly == null)
+ {
+ Log.Warn("NUIGadgetAssembly.Load(): " + info.ResourcePath + info.ExecutableFile + " ++");
+ info.Assembly = Assembly.Load(File.ReadAllBytes(info.ResourcePath + info.ExecutableFile));
+ Log.Warn("NUIGadgetAssembly.Load(): " + info.ResourcePath + info.ExecutableFile + " --");
+ }
}
catch (FileLoadException e)
{
throw new InvalidOperationException(e.Message);
}
- NUIGadget gadget = assembly.CreateInstance(className, true) as NUIGadget;
+ NUIGadget gadget = info.Assembly.CreateInstance(className, true) as NUIGadget;
if (gadget == null)
{
throw new InvalidOperationException("Failed to create instance. className: " + className);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
+
+ /// <summary>
+ /// Generate URI from current buffer.
+ /// </summary>
+ /// <param name="pixelFormat">The pixel format for this frame buffer</param>
+ /// <param name="width">The width for this frame buffer</param>
+ /// <param name="height">The height for this frame buffer</param>
+ public ImageUrl GenerateUrl(PixelFormat pixelFormat, int width, int height)
+ {
+ return new ImageUrl(Interop.FrameBuffer.GenerateUrl(this.SwigCPtr.Handle, (int)pixelFormat, width, height), true);
+ }
}
}
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameBuffer_SWIGUpcast")]
public static extern global::System.IntPtr Upcast(global::System.IntPtr jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_FrameBuffer_GenerateUrl")]
+ public static extern global::System.IntPtr GenerateUrl(global::System.IntPtr frameBuffer, int pixelFormat, int width, int height);
}
}
}