VisualSVN是vs上非常好用的svn插件。可以快速方便得查看修改差异。并支持相关svn操作。
目录
C:\Users{username}\AppData\Local\Microsoft\VisualStudio\17.0_d873d0f6\Extensions\5xuf2xea.r4x
VisualSVN.Core.L.dll
├───VisualSVN.Core
└───VisualSVN.Core.Licensing
├───License
│ └───CreatePregeneratedLicense
├───LicenseConverter
│ ├───KeyToLicense
│ └───KeyToLicenseUnsafe
└───PlainLicenseSerializer
├───Deserialize
└───ParsePlainDate
VisualSVN.Core.Licensing
License
CreatePregeneratedLicense
// Token: 0x0600001C RID: 28 RVA: 0x00002448 File Offset: 0x00001448
public static License CreatePregeneratedLicense(DateTime startTime)
{
License license = new License();
license.StartTime = startTime;
license.EndTime = license.StartTime.AddDays(30.0);
license.Type = LicenseType.Evaluation;
license.LicensedTo = "Evaluation User";
license.IsPregenerated = true;
license.Capacity = 1;
license.Binding = LicenseBinding.Seat;
return license;
}
从以上代码可知,试用期许可证的结束时间为开始时间加上30天(30天试用期)。
该方法被PlainLicenseSerializer.Deserialize引用
LicenseConverter
KeyToLicense
// Token: 0x06000022 RID: 34 RVA: 0x00002670 File Offset: 0x00001670
public static License KeyToLicense(IDecoder decoder, string key)
{
try
{
return LicenseConverter.KeyToLicenseUnsafe(decoder, key);
}
catch (Exception ex)
{
Log.ReportException(ex);
}
return null;
}
KeyToLicenseUnsafe
// Token: 0x06000021 RID: 33 RVA: 0x0000262C File Offset: 0x0000162C
public static License KeyToLicenseUnsafe(IDecoder decoder, string key)
{
char c;
string text = LicenseConverter.ExtractKeyBody(key, out c);
if (text == null)
{
return null;
}
if (c == 'C')
{
return OldLicenseSerializer.Deserialize(text, decoder);
}
if (c == 'N')
{
return NewLicenseSerializer.Deserialize(text, decoder);
}
if (c == 'P')
{
return PlainLicenseSerializer.Deserialize(text);
}
return null;
}
该方法被LicenseConverter.KeyToLicense引用
PlainLicenseSerializer
Deserialize
// Token: 0x0600004B RID: 75 RVA: 0x00003348 File Offset: 0x00002348
public static License Deserialize(string key)
{
DateTime startTime = PlainLicenseSerializer.ParsePlainDate(key);
return License.CreatePregeneratedLicense(startTime);
}
该方法被LicenseConverter.KeyToLicenseUnsafe引用
ParsePlainDate
// Token: 0x0600004C RID: 76 RVA: 0x00003364 File Offset: 0x00002364
private static DateTime ParsePlainDate(string plainKey)
{
DateTime result;
try
{
if (plainKey.Length < 10)
{
throw new LicensingException("Cannot parse license date.");
}
string text = "";
for (int i = 0; i < plainKey.Length; i++)
{
text += (plainKey[i] - '\n').ToString();
}
int day = int.Parse(text.Substring(4, 2));
int month = int.Parse(text.Substring(18, 2));
int year = int.Parse(text.Substring(10, 4));
result = new DateTime(year, month, day);
}
catch (FormatException inner)
{
throw new LicensingException("Cannot parse license date. Date format is invalid.", inner);
}
catch (OverflowException inner2)
{
throw new LicensingException("Cannot parse license date. Date is not in correct range.", inner2);
}
return result;
}
该方法被PlainLicenseSerializer.Deserialize引用