Permalink
Browse files

Added xml comments to public class/members

  • Loading branch information...
HEskandari committed Aug 14, 2010
1 parent 8e91910 commit 504845f8a4bf5479b4c3bf254dc34906d2ed7a93

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -3,22 +3,42 @@
namespace Rhino.Licensing
{
+ /// <summary>
+ ///
+ /// </summary>
public class FloatingLicenseNotAvialableException : RhinoLicensingException
{
+ /// <summary>
+ /// Creates a new instance of <seealso cref="FloatingLicenseNotAvialableException"/>.
+ /// </summary>
public FloatingLicenseNotAvialableException()
{
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="FloatingLicenseNotAvialableException"/>.
+ /// </summary>
+ /// <param name="message">error message</param>
public FloatingLicenseNotAvialableException(string message)
: base(message)
{
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="FloatingLicenseNotAvialableException"/>.
+ /// </summary>
+ /// <param name="message">error message</param>
+ /// <param name="inner">inner exception</param>
public FloatingLicenseNotAvialableException(string message, Exception inner)
: base(message, inner)
{
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="FloatingLicenseNotAvialableException"/>.
+ /// </summary>
+ /// <param name="info">serialization information</param>
+ /// <param name="context">streaming context</param>
protected FloatingLicenseNotAvialableException(
SerializationInfo info,
StreamingContext context)
@@ -1,11 +1,22 @@
-using System;
-using System.ServiceModel;
-namespace Rhino.Licensing
-{
- [ServiceContract(SessionMode = SessionMode.NotAllowed)]
- public interface ILicensingService
- {
- [OperationContract]
- string LeaseLicense(string machine, string user, Guid id);
- }
+using System;
+using System.ServiceModel;
+
+namespace Rhino.Licensing
+{
+ /// <summary>
+ /// Service contract of the licensing server.
+ /// </summary>
+ [ServiceContract(SessionMode = SessionMode.NotAllowed)]
+ public interface ILicensingService
+ {
+ /// <summary>
+ /// Issues a float license for the user.
+ /// </summary>
+ /// <param name="machine">machine name</param>
+ /// <param name="user">user name</param>
+ /// <param name="id">Id of the license holder</param>
+ /// <returns></returns>
+ [OperationContract]
+ string LeaseLicense(string machine, string user, Guid id);
+ }
}
@@ -1,11 +1,19 @@
-using System.ServiceModel;
-
-namespace Rhino.Licensing
-{
- [ServiceContract]
- public interface ISubscriptionLicensingService
- {
- [OperationContract]
- string LeaseLicense(string previousLicense);
- }
+using System.ServiceModel;
+
+namespace Rhino.Licensing
+{
+ /// <summary>
+ /// Service contract of subscription server.
+ /// </summary>
+ [ServiceContract]
+ public interface ISubscriptionLicensingService
+ {
+ /// <summary>
+ /// Issues a leased license
+ /// </summary>
+ /// <param name="previousLicense"></param>
+ /// <returns></returns>
+ [OperationContract]
+ string LeaseLicense(string previousLicense);
+ }
}
@@ -1,8 +1,18 @@
namespace Rhino.Licensing
{
+ /// <summary>
+ /// InvalidationType
+ /// </summary>
public enum InvalidationType
{
+ /// <summary>
+ /// Can not create a new license
+ /// </summary>
CannotGetNewLicense,
+
+ /// <summary>
+ /// License is expired
+ /// </summary>
TimeExpired
}
}
@@ -3,23 +3,44 @@
namespace Rhino.Licensing
{
+ /// <summary>
+ /// Thrown when a valid license file can not be
+ /// found on the client machine.
+ /// </summary>
[Serializable]
public class LicenseFileNotFoundException : RhinoLicensingException
{
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseFileNotFoundException"/>
+ /// </summary>
public LicenseFileNotFoundException()
{
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseFileNotFoundException"/>
+ /// </summary>
+ /// <param name="message">error message</param>
public LicenseFileNotFoundException(string message)
: base(message)
{
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseFileNotFoundException"/>
+ /// </summary>
+ /// <param name="message">error message</param>
+ /// <param name="inner">inner exception</param>
public LicenseFileNotFoundException(string message, Exception inner)
: base(message, inner)
{
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseFileNotFoundException"/>
+ /// </summary>
+ /// <param name="info">serialization information</param>
+ /// <param name="context">streaming context</param>
protected LicenseFileNotFoundException(
SerializationInfo info,
StreamingContext context) : base(info, context)
@@ -9,15 +9,28 @@
namespace Rhino.Licensing
{
+ /// <summary>
+ /// LicenseGenerator generates and signs license.
+ /// </summary>
public class LicenseGenerator
{
private readonly string privateKey;
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseGenerator"/>.
+ /// </summary>
+ /// <param name="privateKey">private key of the product</param>
public LicenseGenerator(string privateKey)
{
this.privateKey = privateKey;
}
+ /// <summary>
+ /// Generates a new floating license.
+ /// </summary>
+ /// <param name="name">Name of the license holder</param>
+ /// <param name="publicKey">public key of the license server</param>
+ /// <returns>license content</returns>
public string GenerateFloatingLicense(string name, string publicKey)
{
using (var rsa = new RSACryptoServiceProvider())
@@ -49,11 +62,29 @@ public string GenerateFloatingLicense(string name, string publicKey)
return new StreamReader(ms).ReadToEnd();
}
}
+
+ /// <summary>
+ /// Generates a new license
+ /// </summary>
+ /// <param name="name">name of the license holder</param>
+ /// <param name="id">Id of the license holder</param>
+ /// <param name="expirationDate">expiry date</param>
+ /// <param name="licenseType">type of the license</param>
+ /// <returns></returns>
public string Generate(string name, Guid id, DateTime expirationDate, LicenseType licenseType)
{
return Generate(name, id, expirationDate, new Dictionary<string, string>(), licenseType);
}
+ /// <summary>
+ /// Generates a new license
+ /// </summary>
+ /// <param name="name">name of the license holder</param>
+ /// <param name="id">Id of the license holder</param>
+ /// <param name="expirationDate">expiry date</param>
+ /// <param name="licenseType">type of the license</param>
+ /// <param name="attributes">extra information stored as key/valye in the license file</param>
+ /// <returns></returns>
public string Generate(string name, Guid id, DateTime expirationDate, IDictionary<string, string> attributes, LicenseType licenseType)
{
using (var rsa = new RSACryptoServiceProvider())
@@ -3,21 +3,43 @@
namespace Rhino.Licensing
{
+ /// <summary>
+ /// Thrown when suitable license is not found.
+ /// </summary>
[Serializable]
public class LicenseNotFoundException : RhinoLicensingException
{
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseNotFoundException"/>.
+ /// </summary>
public LicenseNotFoundException()
{
}
- public LicenseNotFoundException(string message) : base(message)
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseNotFoundException"/>.
+ /// </summary>
+ /// <param name="message">error message</param>
+ public LicenseNotFoundException(string message)
+ : base(message)
{
}
- public LicenseNotFoundException(string message, Exception inner) : base(message, inner)
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseNotFoundException"/>.
+ /// </summary>
+ /// <param name="message">error message</param>
+ /// <param name="inner">inner exception</param>
+ public LicenseNotFoundException(string message, Exception inner)
+ : base(message, inner)
{
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseNotFoundException"/>.
+ /// </summary>
+ /// <param name="info">serialization information</param>
+ /// <param name="context">steaming context</param>
protected LicenseNotFoundException(
SerializationInfo info,
StreamingContext context) : base(info, context)
@@ -1,12 +1,38 @@
namespace Rhino.Licensing
{
+ /// <summary>
+ /// License Type
+ /// </summary>
public enum LicenseType
{
+ /// <summary>
+ /// No type specified
+ /// </summary>
None,
+
+ /// <summary>
+ /// For trial use
+ /// </summary>
Trial,
+
+ /// <summary>
+ /// Standard license
+ /// </summary>
Standard,
+
+ /// <summary>
+ /// For personal use
+ /// </summary>
Personal,
+
+ /// <summary>
+ /// Floating license
+ /// </summary>
Floating,
+
+ /// <summary>
+ /// Subscription based license
+ /// </summary>
Subscription
}
}
@@ -3,23 +3,42 @@
namespace Rhino.Licensing
{
+ /// <summary>
+ /// License validator validates a license file
+ /// that can be located on disk.
+ /// </summary>
public class LicenseValidator : AbstractLicenseValidator
{
private readonly string licensePath;
private string inMemoryLicense;
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseValidator"/>.
+ /// </summary>
+ /// <param name="publicKey">public key</param>
+ /// <param name="licensePath">path to license file</param>
public LicenseValidator(string publicKey, string licensePath)
: base(publicKey)
{
this.licensePath = licensePath;
}
+ /// <summary>
+ /// Creates a new instance of <seealso cref="LicenseValidator"/>.
+ /// </summary>
+ /// <param name="publicKey">public key</param>
+ /// <param name="licensePath">path to license file</param>
+ /// <param name="licenseServerUrl">license server endpoint address</param>
+ /// <param name="clientId">Id of the license holder</param>
public LicenseValidator(string publicKey, string licensePath, string licenseServerUrl, Guid clientId)
: base(publicKey, licenseServerUrl, clientId)
{
this.licensePath = licensePath;
}
+ /// <summary>
+ /// Gets or Sets the license content
+ /// </summary>
protected override string License
{
get
@@ -40,6 +59,9 @@ protected override string License
}
}
+ /// <summary>
+ /// Validates loaded license
+ /// </summary>
public override void AssertValidLicense()
{
if (File.Exists(licensePath) == false)
@@ -51,6 +73,9 @@ public override void AssertValidLicense()
base.AssertValidLicense();
}
+ /// <summary>
+ /// Removes existing license from the machine.
+ /// </summary>
public override void RemoveExistingLicense()
{
File.Delete(licensePath);
Oops, something went wrong.

0 comments on commit 504845f

Please sign in to comment.