mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
Revert "Enable Trial"
This commit is contained in:
parent
a41b6ad0d8
commit
983f0623b1
@ -315,7 +315,7 @@ namespace Twiglet.CS2J.Translator
|
|||||||
// Add the namespace.
|
// Add the namespace.
|
||||||
XmlNamespaceManager nsmgr = new XmlNamespaceManager(Doc.NameTable);
|
XmlNamespaceManager nsmgr = new XmlNamespaceManager(Doc.NameTable);
|
||||||
nsmgr.AddNamespace("ss", "http://www.w3.org/2000/09/xmldsig#");
|
nsmgr.AddNamespace("ss", "http://www.w3.org/2000/09/xmldsig#");
|
||||||
|
|
||||||
XmlNode root = Doc.DocumentElement;
|
XmlNode root = Doc.DocumentElement;
|
||||||
XmlNodeList nodeList = root.SelectNodes("/*/ss:Signature", nsmgr);
|
XmlNodeList nodeList = root.SelectNodes("/*/ss:Signature", nsmgr);
|
||||||
// fail if no signature was found.
|
// fail if no signature was found.
|
||||||
@ -340,33 +340,37 @@ namespace Twiglet.CS2J.Translator
|
|||||||
public static void addNetTranslation(string fullName)
|
public static void addNetTranslation(string fullName)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Suchk in translation file
|
// Suck in translation file
|
||||||
Stream txStream = new FileStream(fullName, FileMode.Open, FileAccess.Read);
|
Stream txStream = new FileStream(fullName, FileMode.Open, FileAccess.Read);
|
||||||
|
|
||||||
|
if (numLines < numLines - 1)
|
||||||
|
{
|
||||||
|
// TRIAL ONLY
|
||||||
|
// Create a new XML document.
|
||||||
|
XmlDocument xmlDoc = new XmlDocument();
|
||||||
|
|
||||||
// Create a new XML document.
|
// Load an XML file into the XmlDocument object.
|
||||||
XmlDocument xmlDoc = new XmlDocument();
|
xmlDoc.PreserveWhitespace = true;
|
||||||
|
xmlDoc.Load(txStream);
|
||||||
|
|
||||||
// Load an XML file into the XmlDocument object.
|
// Verify the signature of the signed XML.
|
||||||
xmlDoc.PreserveWhitespace = true;
|
if (!VerifyXml(xmlDoc, RsaKey))
|
||||||
xmlDoc.Load(txStream);
|
{
|
||||||
|
Console.Out.WriteLine("Bad / Missing signature found for " + fullName);
|
||||||
|
badXmlTxCount--;
|
||||||
|
if (badXmlTxCount <= 0)
|
||||||
|
{
|
||||||
|
Console.Out.WriteLine("\n This is a trial version of CS2J. It is to be used for evaluation purposes only.");
|
||||||
|
Console.Out.WriteLine(" The .Net translations that you are using contain more than " + badXmlTxCountTrigger + " unsigned or modified translation files.");
|
||||||
|
Console.Out.WriteLine(" Please reduce the number of unsigned and modified translation files and try again.");
|
||||||
|
Console.Out.WriteLine("\n Contact Twiglet Software at info@twigletsoftware.com (http://www.twigletsoftware.com) for licensing details.");
|
||||||
|
Environment.Exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Verify the signature of the signed XML.
|
txStream.Seek(0, SeekOrigin.Begin);
|
||||||
if (!VerifyXml(xmlDoc, RsaKey))
|
}
|
||||||
{
|
TypeRepTemplate t = TypeRepTemplate.newInstance(txStream);
|
||||||
Console.Out.WriteLine("Bad / Missing signature found for " + fullName);
|
|
||||||
badXmlTxCount--;
|
|
||||||
if (badXmlTxCount <= 0)
|
|
||||||
{
|
|
||||||
Console.Out.WriteLine("\n This is a trial version of CS2J. It is to be used for evaluation purposes only.");
|
|
||||||
Console.Out.WriteLine(" The .Net translations that you are using contain more than " + badXmlTxCountTrigger + " unsigned or modified translation files.");
|
|
||||||
Console.Out.WriteLine(" Please reduce the number of unsigned and modified translation files and try again.");
|
|
||||||
Console.Out.WriteLine("\n Contact Twiglet Software at info@twigletsoftware.com (http://www.twigletsoftware.com) for licensing details.");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
txStream.Seek(0, SeekOrigin.Begin);
|
|
||||||
TypeRepTemplate t = TypeRepTemplate.newInstance(txStream);
|
|
||||||
// Fullname has form: <path>/<key>.xml
|
// Fullname has form: <path>/<key>.xml
|
||||||
AppEnv[t.TypeName+(t.TypeParams != null && t.TypeParams.Length > 0 ? "'" + t.TypeParams.Length.ToString() : "")] = t;
|
AppEnv[t.TypeName+(t.TypeParams != null && t.TypeParams.Length > 0 ? "'" + t.TypeParams.Length.ToString() : "")] = t;
|
||||||
}
|
}
|
||||||
@ -398,6 +402,9 @@ namespace Twiglet.CS2J.Translator
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static string limit(string inp) {
|
private static string limit(string inp) {
|
||||||
|
if (numLines > numLines - 1)
|
||||||
|
return inp;
|
||||||
|
// TRIAL ONLY
|
||||||
String[] lines = inp.Split(newLines, numLines+1, StringSplitOptions.None);
|
String[] lines = inp.Split(newLines, numLines+1, StringSplitOptions.None);
|
||||||
if (lines.Length <= numLines) {
|
if (lines.Length <= numLines) {
|
||||||
return inp;
|
return inp;
|
||||||
|
@ -19,8 +19,6 @@ itsmine(now, includeDate) ::= <<
|
|||||||
//
|
//
|
||||||
// This file was translated from C# to Java by CS2J (http://www.cs2j.com).
|
// This file was translated from C# to Java by CS2J (http://www.cs2j.com).
|
||||||
//
|
//
|
||||||
// This code is to be used for evaluation of the CS2J tool ONLY.
|
|
||||||
//
|
|
||||||
// For more information about CS2J please contact cs2jcontact@scorm.com
|
// For more information about CS2J please contact cs2jcontact@scorm.com
|
||||||
<if(includeDate)>
|
<if(includeDate)>
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user