Exemplo n.º 1
0
        /// <summary>
        /// Creates a RemoteView object.
        /// </summary>
        /// <param name="parent">Parent object.</param>
        /// <param name="widgetId">Widget ID.</param>
        /// <param name="content">Contents that will be given to the widget instance.</param>
        /// <param name="period">Update period.</param>
        /// <param name="previewImage">True if you want to show the preview image.</param>
        /// <param name="overlayText">True if you want to show the overlay text.</param>
        /// <param name="loadingMessage">True if you want to show the loading message.</param>
        /// <returns>RemoteView object.</returns>
        /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
        /// <exception cref="InvalidOperationException">Thrown when this operation failed.</exception>
        /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
        /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
        /// <since_tizen> 3 </since_tizen>
        public static RemoteView Create(EvasObject parent, string widgetId, string content, double period,
                                        bool previewImage = true, bool overlayText = true, bool loadingMessage = true)
        {
            if (!_ready)
            {
                throw new InvalidOperationException("Not initialized");
            }

            var obj = new RemoteView()
            {
                Layout = new RemoteWindow(parent, widgetId, content, period)
            };

            if (!previewImage)
            {
                obj.HidePreviewImage();
            }

            if (!overlayText)
            {
                obj.HideOverlayText();
            }

            if (!loadingMessage)
            {
                obj.HideLoadingMessage();
            }

            return(obj);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes RemoteViewFactory.
 /// </summary>
 /// <param name="win">Window object that will contain RemoteViews that are generated by RemoteViewFactory.
 /// All the remote views will be located in the specified window object.
 /// </param>
 /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
 /// <exception cref="InvalidOperationException">Thrown when this operation failed.</exception>
 /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
 /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
 /// <since_tizen> 3 </since_tizen>
 public static void Init(EvasObject win)
 {
     if (_ready)
     {
         throw new InvalidOperationException("Already initialized");
     }
     RemoteView.CheckException(Interop.WidgetViewerEvas.Init(win));
     _ready = true;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Finalizes the RemoteViewFactory.
 /// </summary>
 /// <privilege>http://tizen.org/privilege/widget.viewer</privilege>
 /// <exception cref="InvalidOperationException">Thrown when this operation failed.</exception>
 /// <exception cref="UnauthorizedAccessException">Thrown when this operation is denied.</exception>
 /// <exception cref="NotSupportedException">Thrown when this operation is not supported for this device.</exception>
 /// <since_tizen> 3 </since_tizen>
 public static void Shutdown()
 {
     if (!_ready)
     {
         throw new InvalidOperationException("Not initialized");
     }
     RemoteView.CheckException(Interop.WidgetViewerEvas.Fini());
     _ready = false;
 }
Exemplo n.º 4
0
        private static EvasObject PrepareHandle(EvasObject parent, string widgetId, string content, double period)
        {
            _handle = Interop.WidgetViewerEvas.AddWidget(parent, widgetId, content, period);

            int err = Internals.Errors.ErrorFacts.GetLastResult();

            RemoteView.CheckException((Interop.WidgetViewerEvas.ErrorCode)err);

            if (_handle == IntPtr.Zero)
            {
                throw new InvalidOperationException("Return null pointer");
            }

            return(parent);
        }