Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions src/WebKit/WKWebExtensionMatchPattern.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using Foundation;

namespace WebKit {
public partial class WKWebExtensionMatchPattern {
/// <summary>Create a new <see cref="WKWebExtensionMatchPattern" /> for the specified pattern.</summary>
/// <param name="string">The pattern to initialize the new instance with.</param>
/// <param name="error">The error object, if an error occurred, otherwise null.</param>
/// <returns>A newly created <see cref="WKWebExtensionMatchPattern" /> if successful, otherwise null.</returns>
public static WKWebExtensionMatchPattern? Create (string @string, out NSError? error)
{
var rv = new WKWebExtensionMatchPattern (NSObjectFlag.Empty);
rv.InitializeHandle (rv._InitWithString (@string, out error), string.Empty, false);
if (rv.Handle == IntPtr.Zero) {
rv.Dispose ();
return null;
}
return rv;
}

/// <summary>Create a new <see cref="WKWebExtensionMatchPattern" /> for the specified scheme, host and path.</summary>
/// <param name="scheme">The scheme to initialize the new instance with.</param>
/// <param name="host">The host to initialize the new instance with.</param>
/// <param name="path">The path to initialize the new instance with.</param>
/// <param name="error">The error object, if an error occurred, otherwise null.</param>
/// <returns>A newly created <see cref="WKWebExtensionMatchPattern" /> if successful, otherwise null.</returns>
public static WKWebExtensionMatchPattern? Create (string scheme, string host, string path, out NSError? error)
{
var rv = new WKWebExtensionMatchPattern (NSObjectFlag.Empty);
rv.InitializeHandle (rv._InitWithScheme (scheme, host, path, out error), string.Empty, false);
if (rv.Handle == IntPtr.Zero) {
rv.Dispose ();
return null;
}
return rv;
}
}
}
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,7 @@ WEBKIT_SOURCES = \
WebKit/WebView.cs \
WebKit/WKCompat.cs \
WebKit/WKPreferences.cs \
WebKit/WKWebExtensionMatchPattern.cs \
WebKit/WKWindowFeatures.cs \

#
Expand Down
Loading
Loading