示例#1
0
        public static bool TryFromValue(out SciterText sciterText, SciterValue sciterValue)
        {
            var value  = sciterValue.ToVALUE();
            var result = GraphicsApi.ValueUnWrapText(ref value, out var textHandle)
                         .IsOk();

            sciterText = result ? new SciterText(textHandle) : default;
            return(result);
        }
示例#2
0
        public static bool TryCreate(out SciterImage sciterImage, SciterValue sciterValue)
        {
            var v      = sciterValue.ToVALUE();
            var result = GraphicsApi.ValueUnWrapImage(ref v, out var imageHandle)
                         .IsOk();

            sciterImage = result ? new SciterImage(imageHandle: imageHandle) : default;
            return(result);
        }
示例#3
0
        private static bool TryCreatePrivate(out SciterPath sciterPath, SciterValue sciterValue, bool ignoreResult)
        {
            var value  = sciterValue.ToVALUE();
            var result = GraphicsApi.ValueUnWrapPath(ref value, out var pathHandle)
                         .IsOk();

            sciterPath = (result || ignoreResult) ? new SciterPath(pathHandle: pathHandle) : default;

            return(result);
        }
示例#4
0
        public static bool TryCreate(SciterValue sciterValue, out SciterGraphics sciterGraphics)
        {
            var value  = sciterValue.ToVALUE();
            var result = GraphicsApi.ValueUnWrapGfx(ref value, out var graphicsHandle)
                         .IsOk();

            sciterGraphics = result ? new SciterGraphics(graphicsHandle: graphicsHandle) : default;

            return(result);
        }
示例#5
0
		/// <summary>
		/// For example media type can be "handheld:true", "projection:true", "screen:true", etc.
		/// By default sciter window has "screen:true" and "desktop:true"/"handheld:true" media variables.
		/// Media variables can be changed in runtime. This will cause styles of the document to be reset.
		/// </summary>
		/// <param name="mediaVars">Map that contains name/value pairs - media variables to be set</param>
		public bool SetMediaVars(SciterValue mediaVars)
		{
			SciterXValue.VALUE v = mediaVars.ToVALUE();
			return _api.SciterSetMediaVars(_hwnd, ref v);
		}