本文整理汇总了C#中System.Xml.Xsl.XsltArgumentList.GetParam方法的典型用法代码示例。如果您正苦于以下问题:C# XsltArgumentList.GetParam方法的具体用法?C# XsltArgumentList.GetParam怎么用?C# XsltArgumentList.GetParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.XsltArgumentList
的用法示例。
在下文中一共展示了XsltArgumentList.GetParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParam1
public void GetParam1()
{
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szEmpty, "Test1");
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test1", retObj);
if (retObj.ToString() != "Test1")
Assert.True(false);
return;
}
示例2: AddParameter
/// <summary>
/// Adds a new xsl parameter with to the specified argument list.
/// </summary>
/// <param name="name">The name of the parameter.</param>
/// <param name="value">The value of the parameter.</param>
/// <param name="parameters">The parameter list.</param>
/// <returns>Whether the parameter was added.</returns>
/// <remarks>Does not add the parameter
/// when a parameter with the same name is already part of the <paramref name="parameters"/>.</remarks>
private bool AddParameter(string name, string value, XsltArgumentList parameters)
{
bool result;
if (parameters.GetParam(name, string.Empty) == null)
{
parameters.AddParam(name, string.Empty, value);
Log.LogMessage(MessageImportance.Low, Resources.XsltAddingParameter, name, value);
result = true;
}
else
{
// don't add the parameter when already provided by other xml metadata
result = false;
}
return result;
}
示例3: GetParamDoubles
public void GetParamDoubles()
{
double d1 = double.PositiveInfinity;
double d2 = double.NegativeInfinity;
double d3 = double.NaN;
double d4 = 2.000001;
double d5 = 0.00;
double d6 = double.MaxValue;
double d7 = double.MinValue;
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szEmpty, d1);
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", d1, retObj);
if (!double.IsPositiveInfinity((double)retObj))
{
_output.WriteLine("Failed to add/get a value for {0}", d1);
_output.WriteLine("Retrieved: {0} ", retObj);
Assert.True(false);
}
m_xsltArg.AddParam("myArg2", szEmpty, d2);
retObj = m_xsltArg.GetParam("myArg2", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", d2, retObj);
if (!double.IsNegativeInfinity((double)retObj))
{
_output.WriteLine("Failed to add/get a value for {0}", d2);
_output.WriteLine("Retrieved: {0} ", retObj);
Assert.True(false);
}
m_xsltArg.AddParam("myArg3", szEmpty, d3);
retObj = m_xsltArg.GetParam("myArg3", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", d3, retObj);
if (!double.IsNaN((double)retObj))
{
_output.WriteLine("Failed to add/get a value for {0}", d3);
_output.WriteLine("Retrieved: {0} ", retObj);
Assert.True(false);
}
m_xsltArg.AddParam("myArg4", szEmpty, d4);
retObj = m_xsltArg.GetParam("myArg4", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", d4, retObj);
if (!d4.Equals((double)retObj))
{
_output.WriteLine("Failed to add/get a value for {0}", d4);
_output.WriteLine("Retrieved: {0} ", retObj);
Assert.True(false);
}
m_xsltArg.AddParam("myArg5", szEmpty, d5);
retObj = m_xsltArg.GetParam("myArg5", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", d5, retObj);
if (!d5.Equals(retObj))
{
_output.WriteLine("Failed to add/get a value for {0}", d5);
_output.WriteLine("Retrieved: {0} ", retObj);
Assert.True(false);
}
m_xsltArg.AddParam("myArg6", szEmpty, d6);
retObj = m_xsltArg.GetParam("myArg6", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", d6, retObj);
if (!d6.Equals(retObj))
{
_output.WriteLine("Failed to add/get a value for {0}", d6);
_output.WriteLine("Retrieved: {0} ", retObj);
Assert.True(false);
}
m_xsltArg.AddParam("myArg7", szEmpty, d7);
retObj = m_xsltArg.GetParam("myArg7", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", d7, retObj);
if (!d7.Equals(retObj))
{
_output.WriteLine("Failed to add/get a value for {0}", d7);
_output.WriteLine("Retrieved: {0} ", retObj);
Assert.True(false);
}
return;
}
示例4: GetParam18
public void GetParam18()
{
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szEmpty, "Test1");
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test1", retObj);
m_xsltArg.AddParam("myArg1", "http://www.msn.com", "Test2");
retObj = m_xsltArg.GetParam("myArg1", "http://www.msn.com");
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test2", retObj);
if (retObj.ToString() != "Test2")
Assert.True(false);
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
_output.WriteLine("Retrieve Original Value:{0}\nActual Retrieved Value: {1}", "Test1", retObj);
if (retObj.ToString() != "Test1")
Assert.True(false);
return;
}
示例5: GetParam16
public void GetParam16()
{
m_xsltArg = new XsltArgumentList();
int i = 0;
m_xsltArg.AddParam("myArg1", szEmpty, "Test16");
for (i = 0; i < 200; i++)
{
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
if (retObj.ToString() != "Test16")
{
_output.WriteLine("Failed after retrieving {0} times", i);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test16", retObj);
Assert.True(false);
}
}
_output.WriteLine("Retrievied {0} times", i);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test1", retObj);
return;
}
示例6: GetParam14
public void GetParam14()
{
int i = 1;
m_xsltArg = new XsltArgumentList();
foreach (String str in szWhiteSpace)
{
m_xsltArg.AddParam("myArg" + i, szEmpty, "Test" + str);
retObj = m_xsltArg.GetParam("myArg" + i, szEmpty);
if (retObj.ToString() != "Test" + str)
{
_output.WriteLine("Error processing {0} test for whitespace arg in first set", i);
Assert.True(false);
}
i++;
}
foreach (String str in szWhiteSpace)
{
m_xsltArg.AddParam("myArg" + i, szEmpty, "Test"); // dont add whitespace to name here since addparam would throw
retObj = m_xsltArg.GetParam("myArg" + str, szEmpty);
if (retObj != null)
{
_output.WriteLine("Error processing {0} test for whitespace arg in second set. Returned object is not null.", i);
Assert.True(false);
}
i++;
}
return;
}
示例7: Clear7
public void Clear7(object param)
{
string Baseline = "baseline\\" + (string)param;
m_xsltArg = new XsltArgumentList();
XsltArgumentList m_2 = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szEmpty, "Test1");
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
if (retObj.ToString() != "Test1")
return; //TEST_SKIPPED;
m_2.Clear();
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}
示例8: Clear5
public void Clear5(object param)
{
string Baseline = "baseline\\" + (string)param;
m_xsltArg = new XsltArgumentList();
String obj = "Test";
for (int i = 0; i < 200; i++)
{
m_xsltArg.AddParam("myArg2", szEmpty, obj + i);
retObj = m_xsltArg.GetParam("myArg2", szEmpty);
if (retObj.ToString() != (obj + i))
{
_output.WriteLine("Failed to add/remove iteration {0}", i);
_output.WriteLine("{0} : {1}", retObj, obj + i);
Assert.True(false);
}
m_xsltArg.Clear();
}
for (int i = 0; i < 200; i++)
{
m_xsltArg.AddParam("myArg" + i, szEmpty, obj + i);
retObj = m_xsltArg.GetParam("myArg" + i, szEmpty);
if (retObj.ToString() != (obj + i))
{
_output.WriteLine("Failed in 2nd part to add/remove iteration {0}", i);
Assert.True(false);
}
}
// _output.WriteLine(retObj.GetType());
m_xsltArg.Clear();
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}
示例9: AddParam21
public void AddParam21()
{
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szXslNS, "Test1");
retObj = m_xsltArg.GetParam("myArg1", szXslNS);
Assert.True(retObj.ToString() == "Test1");
}
示例10: AddParam20
public void AddParam20(object param)
{
string Baseline = "baseline\\" + (string)param;
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", "urn:" + szXslNS, "Test1");
retObj = m_xsltArg.GetParam("myArg1", "urn:" + szXslNS);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test1", retObj);
if (retObj.ToString() != "Test1")
Assert.True(false);
m_xsltArg.AddParam("myArg2", "urn:tmp", "Test2");
retObj = m_xsltArg.GetParam("myArg2", "urn:tmp");
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test2", retObj);
if (retObj.ToString() != "Test2")
Assert.True(false);
m_xsltArg.AddParam("myArg3", "urn:my-object", "Test3");
retObj = m_xsltArg.GetParam("myArg3", "urn:my-object");
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test3", retObj);
if (retObj.ToString() != "Test3")
Assert.True(false);
m_xsltArg.AddParam("myArg4", "urn:MY-OBJECT", "Test4");
retObj = m_xsltArg.GetParam("myArg4", "urn:MY-OBJECT");
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test4", retObj);
if (retObj.ToString() != "Test4")
Assert.True(false);
if ((LoadXSL("showParamNS.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}
示例11: AddParam19
public void AddParam19(object param)
{
string Baseline = "baseline\\" + (string)param;
m_xsltArg = new XsltArgumentList();
String obj = "Test";
for (int i = 0; i < 300; i++)
{
m_xsltArg.AddParam("myArg" + i, szEmpty, obj + "1");
retObj = m_xsltArg.GetParam("myArg" + i, szEmpty);
if (retObj.ToString() != ("Test" + "1"))
{
_output.WriteLine("Failed to add {0}", "myArg" + i);
Assert.True(false);
}
m_xsltArg.RemoveParam("myArg" + i, szEmpty);
}
m_xsltArg.AddParam("myArg2", szEmpty, "Test2");
retObj = m_xsltArg.GetParam("myArg2", szEmpty);
if (retObj.ToString() != ("Test2"))
Assert.True(false);
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}
示例12: AddParam18
public void AddParam18(object param)
{
string Baseline = "baseline\\" + (string)param;
m_xsltArg = new XsltArgumentList();
String obj = "Test";
for (int i = 1; i < 7; i++)
{
m_xsltArg.AddParam("myArg" + +i, szEmpty, obj + i);
retObj = m_xsltArg.GetParam("myArg" + i, szEmpty);
if (retObj.ToString() != ("Test" + i))
Assert.True(false);
}
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}
示例13: GetParam3
public void GetParam3()
{
m_xsltArg = new XsltArgumentList();
retObj = m_xsltArg.GetParam(szEmpty, szEmpty);
if (retObj != null)
{
_output.WriteLine("Did not return NULL for empty string param name: {0}", retObj);
Assert.True(false);
}
return;
}
示例14: GetParam2
public void GetParam2()
{
m_xsltArg = new XsltArgumentList();
retObj = m_xsltArg.GetParam(null, szEmpty);
if (retObj != null)
{
_output.WriteLine("Did not return NULL for null param name {0}", retObj);
Assert.True(false);
}
else
return;
}
示例15: AddParam13
public void AddParam13(object param)
{
string Baseline = "baseline\\" + (string)param;
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szEmpty, "Test1");
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test1", retObj);
if (retObj.ToString() != "Test1")
Assert.True(false);
m_xsltArg.AddParam("myArg2", szEmpty, "Test2");
retObj = m_xsltArg.GetParam("myArg2", szEmpty);
_output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "Test2", retObj);
if (retObj.ToString() != "Test2")
Assert.True(false);
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
_output.WriteLine("Retrieve Original Value:{0}\nActual Retrieved Value: {1}", "Test1", retObj);
if (retObj.ToString() != "Test1")
Assert.True(false);
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}