Table of Contents

Class BrowserNativeMessaging

Namespace
ZeroInstall.Model.Capabilities
Assembly
ZeroInstall.Model.dll

An application's ability to act as a browser native messaging host.

[Serializable]
[Equatable]
public sealed class BrowserNativeMessaging : DefaultCapability, IEquatable<XmlUnknown>, ICloneable<Capability>, IEquatable<Capability>, IEquatable<DefaultCapability>, IEquatable<BrowserNativeMessaging>
Inheritance
BrowserNativeMessaging
Implements
Inherited Members

Properties

BrowserExtensions

List of browser extensions that should have access to the native messaging host.

[Browsable(false)]
[OrderedEquality]
public List<BrowserExtension> BrowserExtensions { get; }

Property Value

List<BrowserExtension>

Browsers

The browsers the native messaging host can be registered in.

[Browsable(false)]
[OrderedEquality]
public List<string> Browsers { get; }

Property Value

List<string>
See Also

BrowsersString

Used for XML serialization.

[TypeConverter(typeof(BrowserNameConverter))]
[IgnoreEquality]
public string BrowsersString { get; set; }

Property Value

string
See Also

Command

The name of the command in the Feed to use; leave null for NameRun.

[TypeConverter(typeof(CommandNameConverter))]
public string? Command { get; set; }

Property Value

string

ConflictIDs

Identifiers from a namespace global to all Capabilitys. Collisions in this namespace indicate that the concerned Capabilitys are in conflict cannot be registered on a single system at the same time.

[Browsable(false)]
[IgnoreEquality]
public override IEnumerable<string> ConflictIDs { get; }

Property Value

IEnumerable<string>

Remarks

These identifiers are not guaranteed to stay the same between versions. They should not be stored in files but instead always generated on demand.

Name

The name used to call the native messaging host from browser extensions.

public required string Name { get; set; }

Property Value

string

Remarks

Can only contain lowercase alphanumeric characters, underscores and dots. Can't start or end with a dot, and a dot can't be followed by another dot.

Methods

Clone()

Creates a deep copy of this Capability instance.

public override Capability Clone()

Returns

Capability

The new copy of the Capability.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Normalize()

Converts legacy elements, sets default values, etc..

public override void Normalize()

Exceptions

InvalidDataException

A required property is not set or invalid.

ToString()

Returns the capability in the form "Browser: Name => Command". Not safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(BrowserNativeMessaging?, BrowserNativeMessaging?)

Indicates whether the object on the left is equal to the object on the right.

public static bool operator ==(BrowserNativeMessaging? left, BrowserNativeMessaging? right)

Parameters

left BrowserNativeMessaging

The left object

right BrowserNativeMessaging

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(BrowserNativeMessaging?, BrowserNativeMessaging?)

Indicates whether the object on the left is not equal to the object on the right.

public static bool operator !=(BrowserNativeMessaging? left, BrowserNativeMessaging? right)

Parameters

left BrowserNativeMessaging

The left object

right BrowserNativeMessaging

The right object

Returns

bool

true if the objects are not equal; otherwise, false.