コード例 #1
0
        public void SetupPage(string page_from_res_folder)
        {
            string url = "archive://app/" + page_from_res_folder;
            bool   res = _wnd.LoadPage(url);

            Debug.Assert(res);
        }
コード例 #2
0
        public Host(SciterWindow window)
            : base(window : window)
        {
            this.RegisterBehaviorHandler(typeof(ImgDrawBehavior))
            .AttachEventHandler(new HostEventHandler());

#if DEBUG
            string location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            location += "\\..\\..\\..\\..\\..";

            string path = Path.Combine(location, "res", "index.html");

            Uri uri = new Uri(path, UriKind.Absolute);

            Debug.Assert(uri.IsFile);

            Debug.Assert(File.Exists(uri.AbsolutePath));
#else
            Uri uri = new Uri("file:///Users/midiway/Documents/SciterSharp/Tests/SciterTest.Mac/res/index.html", UriKind.Absolute);
#endif

            window.LoadPage(uri: uri);
            window.CenterWindow()
            .Show();
        }
コード例 #3
0
        public Host(SciterWindow wnd)
            : base(wnd)
        {
            RegisterBehaviorHandler(typeof(ImgDrawBehavior));

            wnd.LoadPage("file:///Users/midiway/Documents/SciterSharp/Tests/TestOSX/res/index.html");
            wnd.CenterTopLevelWindow();
            wnd.Show();
        }
コード例 #4
0
 protected void SetupPage(string pageFromResFolder)
 {
     #if DEBUG
     string path = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, "../../data/app/", pageFromResFolder));
     Debug.Assert(File.Exists(path));
     string url = "file://" + path.Replace('\\', '/');
     #else
     string url = "archive://app/" + pageFromResFolder;
     #endif
     bool result = window.LoadPage(url);
     Debug.Assert(result);
 }
コード例 #5
0
        public Host(SciterWindow wnd)
        {
            SetupWindow(wnd);
            RegisterBehaviorHandler(typeof(ImgDrawBehavior));

            wnd.LoadPage("/Users/midiway/Documents/SciterSharp/Tests/TestOSX/res/index.html");
            wnd.CallFunction("CallMe", new SciterValue((args) =>
            {
                return(new SciterValue(123));
            }));
            wnd.CenterTopLevelWindow();
            wnd.Show();
        }
コード例 #6
0
        public static void Run()
        {
#if X64
            SciterX.Use3264DLLNaming = true;
#endif
            PInvokeWindows.OleInitialize(IntPtr.Zero);
            var window = new SciterWindow();
            window.CreateMainWindow(500, 500);
            window.CenterTopLevelWindow();
            var host = new AppHost(window);
            window.LoadPage("archive://app/acrylic-window/acrylic-window-sketch.htm");
            window.Show();
            PInvokeUtils.RunMsgLoop();
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: 623442733/SciterSharp
        public void SetupPage(string path)
        {
                #if DEBUG
            string cwd = System.Environment.CurrentDirectory;
            Debug.Assert(File.Exists(cwd + "\\res\\" + path));
            string url = "file:///" + cwd + "\\res\\" + path;
            url = url.Replace('\\', '/');
                #else
            string url = "archive://app/" + path;
                #endif

            bool res = _wnd.LoadPage(url);
            Debug.Assert(res);
        }
コード例 #8
0
ファイル: Host.cs プロジェクト: ramon-mendes/SciterSharp
        public void SetupPage(string page_from_res_folder)
        {
                #if DEBUG
            string path = Environment.CurrentDirectory + "/../../../res/" + page_from_res_folder;
            Debug.Assert(File.Exists(path));
            path = path.Replace('\\', '/');

            string url = "file://" + path;
                #else
            string url = "archive://app/" + page_from_res_folder;
                #endif

            bool res = _wnd.LoadPage(url);
            Debug.Assert(res);
        }
コード例 #9
0
ファイル: Host.cs プロジェクト: zcwfeng/IconDrop
        public void SetupPage(string page_from_res_folder)
        {
            string path = _rescwd + page_from_res_folder;

            Debug.Assert(File.Exists(path));

#if DEBUG
            string url = "file://" + path;
#else
            string url = "archive://app/" + page_from_res_folder;
#endif

            bool res = _wnd.LoadPage(url);
            Debug.Assert(res);
        }
コード例 #10
0
ファイル: Host.cs プロジェクト: 623442733/SciterSharp
        public void SetupPage(string path)
        {
            string cwd = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            System.Environment.CurrentDirectory = cwd;

                #if DEBUG
            Debug.Assert(File.Exists(cwd + "/res/" + path));
            string url = "file:///" + cwd + "/res/" + path;
                #else
            string url = "archive://app/" + path;
                #endif

            bool res = _wnd.LoadPage(url);
            Debug.Assert(res);
        }
コード例 #11
0
ファイル: Host.cs プロジェクト: ramon-mendes/StickyNotes
        public void SetupPage(string page_from_res_folder)
        {
                #if DEBUG
            string path = Path.GetDirectoryName(Consts.APP_EXE) + "/../../res/" + page_from_res_folder;
            Debug.Assert(File.Exists(path));
            path = path.Replace('\\', '/');
            path = Path.GetFullPath(path);
            Debug.Assert(File.Exists(path));

            string url = "file://" + path;
                #else
            string url = "archive://app/" + page_from_res_folder;
                #endif

            bool res = _wnd.LoadPage(url);
            Debug.Assert(res);
        }
コード例 #12
0
ファイル: Host.cs プロジェクト: wdcossey/SciterCore
        public void SetupPage(string page)
        {
#if DEBUG
            string location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            string path = Path.Combine(location ?? string.Empty, "wwwroot", page);

            Uri uri = new Uri(path, UriKind.Absolute);

            Debug.Assert(uri.IsFile);

            Debug.Assert(File.Exists(uri.AbsolutePath));
#else
            Uri uri = new Uri(baseUri: _archive.Uri, page);
#endif

            _window.LoadPage(uri: uri);
        }
コード例 #13
0
ファイル: Host.cs プロジェクト: ramon-mendes/SciterOxyPlot
        public void SetupPage(string page_from_res_folder)
        {
                #if DEBUG
            string cwd = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).Replace('\\', '/');

                        #if OSX
            Environment.CurrentDirectory = cwd + "/../../../../..";
                        #else
            Environment.CurrentDirectory = cwd + "/../..";
                        #endif

            string path = Environment.CurrentDirectory + "/res/" + page_from_res_folder;
            Debug.Assert(File.Exists(path));

            string url = "file://" + path;
                #else
            string url = "archive://app/" + page_from_res_folder;
                #endif

            bool res = _wnd.LoadPage(url);
            Debug.Assert(res);
        }