Пример #1
0
        /// <summary>
        /// Loads html from the resource
        /// </summary>
        public void LoadResource(Type baseType, String resource)
        {
            #region Arguments checking
            if (baseType == null)
            {
                throw new ArgumentNullException("baseType");
            }

            if (String.IsNullOrEmpty(resource))
            {
                throw new ArgumentNullException("resource");
            }
            #endregion

            var resourceName = ResProtocol.ProtocolPrefix +
                               baseType.AssemblyQualifiedName +
                               ResProtocol.PathSeparator + resource;

            var text = SciterFactory.ResolveBinResource(resourceName, ResourceType.Html);

            if (text == null)
            {
                throw new FileNotFoundException(String.Format("Resource {0} not found", resourceName));
            }

            SciterHostApi.SciterLoadHtml(Handle, text, resourceName);
        }
Пример #2
0
        /// <summary>
        /// Loads html from file
        /// </summary>
        public void LoadResource(String resourceName)
        {
            var text = SciterFactory.ResolveBinResource(resourceName, ResourceType.Html);

            if (text == null)
            {
                throw new FileNotFoundException(String.Format("Resource {0} not found", resourceName));
            }

            SciterHostApi.SciterLoadHtml(Handle, text, resourceName);
        }
Пример #3
0
 /// <summary>
 /// Static initialization
 /// </summary>
 static SciterView()
 {
     SciterFactory.RegisterBehavior <AccessKeys>();
     SciterFactory.RegisterBehavior <ExpandableList>();
     SciterFactory.RegisterBehavior <CollapsibleList>();
 }