Пример #1
0
        public void Test1()
        {
            var list = new CefStringList();

            list.Add("String 1");
            list.Add("String 2");
            list.Add("String 3");

            Assert.That(list.Count, Is.EqualTo(3));

            Assert.That(list[0], Is.EqualTo("String 1"));
            Assert.That(list[1], Is.EqualTo("String 2"));
            Assert.That(list[2], Is.EqualTo("String 3"));

            var list2 = list.Clone();

            list.Clear();

            Assert.That(list.Count, Is.EqualTo(0));
            // TODO: list.Dispose();


            Assert.That(list2.Count, Is.EqualTo(3));
            Assert.That(list2[0], Is.EqualTo("String 1"));
            Assert.That(list2[1], Is.EqualTo("String 2"));
            Assert.That(list2[2], Is.EqualTo("String 3"));

            // TODO: list2.Dispose();
        }
Пример #2
0
 /// <summary>
 /// Gets the names of all existing frames.
 /// </summary>
 public string[] GetFrameNames()
 {
     using (var names = new CefStringList())
     {
         AliveBrowserObject.GetFrameNames(names);
         return(names.ToArray());
     }
 }
Пример #3
0
        public IEnumerable <string> GetFileNames()
        {
            using (var list = new CefStringList())
            {
                Data.GetFileNames(list);

                foreach (string s in list)
                {
                    yield return(s);
                }
            }
        }
Пример #4
0
        public IEnumerable <string> GetFrameNames()
        {
            // FIXME: require valid state (browser will be attached and context is not dropped)
            CefStringList frames = null;

            CefThread.UI.Send((_) =>
            {
                frames = this.browser.GetFrameNames();
            }, null);

            return(frames.AsEnumerable());
        }
Пример #5
0
 public static void Clear(cef_settings_t *self)
 {
     cef_string_t.Clear(&self->cache_path);
     cef_string_t.Clear(&self->user_agent);
     cef_string_t.Clear(&self->product_version);
     cef_string_t.Clear(&self->locale);
     // FIXME: null check?
     CefStringList.DestroyHandle(self->extra_plugin_paths);
     cef_string_t.Clear(&self->log_file);
     cef_string_t.Clear(&self->javascript_flags);
     cef_string_t.Clear(&self->resources_dir_path);
     cef_string_t.Clear(&self->locales_dir_path);
 }
Пример #6
0
 protected internal unsafe override void OnResolveCompleted(CefErrorCode result, CefStringList resolvedIps)
 {
     _implementation.OnResolveCompleted(result, resolvedIps);
 }
Пример #7
0
 public override void OnFaviconUrlChange(CefBrowser browser, CefStringList iconUrls)
 {
     _implementation.OnFaviconUrlChange(browser, iconUrls);
 }
Пример #8
0
 public unsafe void GetCookieableSchemes(CefStringList schemes, ref int includeDefaults)
 {
     _application.GetCookieableSchemes(schemes, ref includeDefaults);
 }
Пример #9
0
 /// <inheritdoc />
 internal protected override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback)
 {
     callback.Cancel();
     return(true);
 }
 /// <summary>
 /// Called to run a file chooser dialog.
 /// </summary>
 /// <param name="browser">The browser object.</param>
 /// <param name="mode">
 /// Represents the type of dialog to display.
 /// </param>
 /// <param name="title">
 /// The title to be used for the dialog and may be empty to show the default title
 /// (&apos;Open&apos; or &apos;Save&apos; depending on the mode).
 /// </param>
 /// <param name="defaultFilePath">
 ///  The path with optional directory and/or file name component that should be
 ///  initially selected in the dialog.
 /// </param>
 /// <param name="acceptFilters">
 /// Used to restrict the selectable file types and may any combination of
 /// <list type="bullet">
 /// <item>valid lower-cased MIME types (e.g. &apos;text/*&apos; or &apos;image/*&apos;);</item>
 /// <item>individual file extensions (e.g. &apos;.txt&apos; or &apos;.png&apos;);</item>
 /// <item>
 /// combined description and file extension delimited using &apos;|&apos; and
 /// &apos;;&apos; (e.g. &apos;Image Types|.png;.gif;.jpg&apos;).
 /// </item>
 /// </list>
 /// </param>
 /// <param name="selectedAcceptFilter">
 /// The 0-based index of the filter that should be selected by default.
 /// </param>
 /// <param name="callback">A callback object.</param>
 /// <returns>
 /// To display a custom dialog return true and execute <paramref name="callback"/>
 /// either inline or at a later time. To display the default dialog return false.
 /// </returns>
 internal protected virtual bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback)
 {
     return(false);
 }
Пример #11
0
 protected internal unsafe override void OnFaviconUrlChange(CefBrowser browser, CefStringList iconUrls)
 {
     _implementation.OnFaviconUrlChange(browser, iconUrls);
 }
 /// <summary>
 /// Called when the page icon changes.
 /// </summary>
 /// <param name="browser"></param>
 /// <param name="iconUrls"></param>
 internal protected virtual void OnFaviconUrlChange(CefBrowser browser, CefStringList iconUrls)
 {
 }
Пример #13
0
 protected internal unsafe override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, CefStringList acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback)
 {
     return(_implementation.OnFileDialog(browser, mode, title, defaultFilePath, acceptFilters, selectedAcceptFilter, callback));
 }
Пример #14
0
 protected internal unsafe override void GetCookieableSchemes(CefStringList schemes, ref int includeDefaults)
 {
     _implementation.GetCookieableSchemes(schemes, ref includeDefaults);
 }
 public override void OnFileDialogDismissed(bool selectedAcceptFilter, CefStringList filePaths)
 {
     _implementation.OnFileDialogDismissed(selectedAcceptFilter, filePaths);
 }
Пример #16
0
 public override void OnResolveCompleted(CefErrorCode result, CefStringList resolvedIps)
 {
     _implementation.OnResolveCompleted(result, resolvedIps);
 }