Files
cefsharp/CefSharp/CefExtension.cs
T
Chris bef5dd37c4 Maintenance - Fixed formatting, file encoding, and copyright year (#2504)
* Applied formatting

* Fixed file encoding + Updated copyright year

* Updated License

* Fixed more file encoding

* Copyright notice now shows the year the file was created
2018-09-10 10:41:13 +10:00

61 lines
1.7 KiB
C#

// Copyright © 2015 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System;
namespace CefSharp
{
/// <summary>
/// Represents a new V8 extension to be registered.
/// </summary>
public sealed class CefExtension
{
/// <summary>
/// Gets the name of the extension.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets the javascript extension code
/// </summary>
public string JavascriptCode { get; private set; }
/// <summary>
/// Creates a new CwefExtension instance with a given name.
/// </summary>
/// <param name="name">Name of the CefExtension</param>
/// <param name="javascriptCode">The javascript extension code.</param>
public CefExtension(string name, string javascriptCode)
{
if (string.IsNullOrEmpty(name))
{
throw new ArgumentNullException("name");
}
if (string.IsNullOrEmpty(javascriptCode))
{
throw new ArgumentNullException("javascriptCode");
}
Name = name;
JavascriptCode = javascriptCode;
}
public override bool Equals(object obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
var ext = (CefExtension)obj;
return Name.Equals(ext.Name);
}
public override int GetHashCode()
{
return Name.GetHashCode();
}
}
}