本文整理汇总了C#中System.Xml.Xsl.XsltArgumentList.RemoveExtensionObject方法的典型用法代码示例。如果您正苦于以下问题:C# XsltArgumentList.RemoveExtensionObject方法的具体用法?C# XsltArgumentList.RemoveExtensionObject怎么用?C# XsltArgumentList.RemoveExtensionObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.XsltArgumentList
的用法示例。
在下文中一共展示了XsltArgumentList.RemoveExtensionObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveExtObj5
public void RemoveExtObj5()
{
m_xsltArg = new XsltArgumentList();
MyObject obj = new MyObject(5, _output);
///nonePermSet.PermitOnly(); ;
m_xsltArg.AddExtensionObject("urn:" + szLongNS, obj);
m_xsltArg.RemoveExtensionObject("urn:" + szLongNS);
///CodeAccessPermission.RevertPermitOnly();
try
{
if ((LoadXSL("MyObjectDef.xsl") == 1))
Transform_ArgList("fruits.xml", true);
}
catch (System.Xml.Xsl.XsltException)
{
return;
}
_output.WriteLine("Did not throw expected exception");
Assert.True(false);
}
示例2: AddExtObject14
public void AddExtObject14(object param)
{
string Baseline = "baseline\\" + (string)param;
MyObject obj = new MyObject(14, _output);
m_xsltArg = new XsltArgumentList();
///nonePermSet.PermitOnly(); ;
for (int i = 0; i < 400; i++)
{
m_xsltArg.AddExtensionObject(szDefaultNS, obj);
m_xsltArg.RemoveExtensionObject(szDefaultNS);
}
m_xsltArg.AddExtensionObject(szDefaultNS, obj);
///CodeAccessPermission.RevertPermitOnly();
if ((LoadXSL("MyObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}
示例3: RemoveExtObj2
public void RemoveExtObj2()
{
MyObject obj = new MyObject(2, _output);
m_xsltArg = new XsltArgumentList();
try
{
m_xsltArg.RemoveExtensionObject(null);
}
catch (System.ArgumentNullException)
{
return;
}
_output.WriteLine("Exception not generated for null parameter name");
Assert.True(false);
}
示例4: RemoveExtObj6
public void RemoveExtObj6()
{
string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result>
1.No Value Specified
2.No Value Specified
3.No Value Specified
4.No Value Specified
5.No Value Specified
6.No Value Specified</result>";
MyObject obj = new MyObject(6, _output);
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddExtensionObject("urn:my-object", obj);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", 2);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", "Test String");
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", (double)5.1);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", true);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", false);
m_xsltArg.RemoveExtensionObject("urn:my-object");
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(expected);
return;
}
else
Assert.True(false);
}
示例5: RemoveExtObj9
public void RemoveExtObj9()
{
MyObject obj = new MyObject(10, _output);
m_xsltArg = new XsltArgumentList();
m_xsltArg.RemoveExtensionObject(szDefaultNS);
// ensure we can still do a transform
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1) &&
(CheckResult(466.5112789241) == 1))
return;
else
Assert.True(false);
}
示例6: RemoveExtObj8
public void RemoveExtObj8()
{
int i = 1;
m_xsltArg = new XsltArgumentList();
///nonePermSet.PermitOnly(); ;
foreach (String str in szWhiteSpace)
{
MyObject obj = new MyObject(i, _output);
m_xsltArg.AddExtensionObject(szDefaultNS + str, obj);
m_xsltArg.RemoveExtensionObject(szDefaultNS + str);
retObj = m_xsltArg.GetExtensionObject(szDefaultNS + str);
if (retObj != null)
{
_output.WriteLine("Error deleting case #{0} for whitespace arg", i);
Assert.True(false);
}
i++;
}
///CodeAccessPermission.RevertPermitOnly();
try
{
if ((LoadXSL("MyObjectDef.xsl") == 1))
Transform_ArgList("fruits.xml", true);
}
catch (System.Xml.Xsl.XsltException)
{
return;
}
_output.WriteLine("Did not exception for object that could not be executed");
Assert.True(false);
}
示例7: Clear8
public void Clear8(object param)
{
string Baseline = "baseline\\" + (string)param;
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szEmpty, "Test1");
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
if (retObj.ToString() != "Test1")
return; //TEST_SKIPPED;
retObj = m_xsltArg.RemoveParam("myArg1", szEmpty);
m_xsltArg.Clear();
if ((LoadXSL("showParam.xsl") != 1) || (Transform_ArgList("fruits.xml") != 1))
Assert.True(false);
VerifyResult(Baseline, _strOutFile);
MyObject obj = new MyObject(26, _output);
m_xsltArg.AddExtensionObject(szDefaultNS, obj);
m_xsltArg.RemoveExtensionObject(szDefaultNS);
m_xsltArg.Clear();
if ((LoadXSL("MyObjectDef.xsl") == 1))
{
try
{
Transform_ArgList("fruits.xml");
}
catch (System.Xml.Xsl.XsltException)
{
return;
}
}
_output.WriteLine("Exception not thrown for NS not found");
Assert.True(false);
}
示例8: RemoveExtObj1
public void RemoveExtObj1()
{
MyObject obj = new MyObject(1, _output);
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddExtensionObject(szDefaultNS, obj);
m_xsltArg.RemoveExtensionObject(szDefaultNS);
try
{
if ((LoadXSL("myObjectDef.xsl") == 1))
Transform_ArgList("fruits.xml", true);
}
catch (System.Xml.Xsl.XsltException)
{
return;
}
_output.WriteLine("Did not throw expected exception");
Assert.True(false);
}
示例9: RemoveExtObj3
public void RemoveExtObj3()
{
MyObject obj = new MyObject(10, _output);
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddExtensionObject(szDefaultNS, obj);
for (int i = 0; i < 500; i++)
m_xsltArg.RemoveExtensionObject(szDefaultNS);
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1) &&
(CheckResult(466.5112789241) == 1))
return;
else
Assert.True(false);
}
示例10: PrepareArgs
//перенесено
public static void PrepareArgs(XsltArgumentList args){
args.RemoveExtensionObject(Namespace);
args.AddExtensionObject(Namespace, new XsltStandardExtension());
}
示例11: RemoveExtObj4
public void RemoveExtObj4(object param)
{
string Baseline = Path.Combine("baseline", (string)param);
MyObject obj = new MyObject(4, _output);
m_xsltArg = new XsltArgumentList();
///nonePermSet.PermitOnly(); ;
m_xsltArg.AddExtensionObject(szDefaultNS, obj);
m_xsltArg.RemoveExtensionObject(szSimple);
///CodeAccessPermission.RevertPermitOnly();
if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}
示例12: Clear8
public void Clear8()
{
string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result>
1.No Value Specified
2.No Value Specified
3.No Value Specified
4.No Value Specified
5.No Value Specified
6.No Value Specified</result>";
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddParam("myArg1", szEmpty, "Test1");
retObj = m_xsltArg.GetParam("myArg1", szEmpty);
if (retObj.ToString() != "Test1")
return; //return TEST_SKIPPED;
retObj = m_xsltArg.RemoveParam("myArg1", szEmpty);
m_xsltArg.Clear();
if ((LoadXSL("showParam.xsl") != 1) || (Transform_ArgList("fruits.xml") != 1))
Assert.True(false);
VerifyResult(expected);
MyObject obj = new MyObject(26, _output);
m_xsltArg.AddExtensionObject(szDefaultNS, obj);
m_xsltArg.RemoveExtensionObject(szDefaultNS);
m_xsltArg.Clear();
if ((LoadXSL("myObjectDef.xsl") == 1))
{
try
{
Transform_ArgList("fruits.xml");
}
catch (System.Xml.Xsl.XsltException)
{
return;
}
}
_output.WriteLine("Exception not thrown for NS not found");
Assert.True(false);
}
示例13: RemoveExtObj9
public void RemoveExtObj9()
{
string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result>
1.No Value Specified
2.No Value Specified
3.No Value Specified
4.No Value Specified
5.No Value Specified
6.No Value Specified</result>";
MyObject obj = new MyObject(10, _output);
m_xsltArg = new XsltArgumentList();
m_xsltArg.RemoveExtensionObject(szDefaultNS);
// ensure we can still do a transform
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(expected);
return;
}
else
Assert.True(false);
}
示例14: RemoveExtObj7
public void RemoveExtObj7()
{
string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object"">
1.Test1
2.Test2
3.Test3</result>";
MyObject obj = new MyObject(7, _output);
m_xsltArg = new XsltArgumentList();
m_xsltArg.AddExtensionObject("urn:my-object", obj);
m_xsltArg.RemoveExtensionObject("URN:MY-OBJECT");
m_xsltArg.RemoveExtensionObject("urn:My-Object");
m_xsltArg.RemoveExtensionObject("urn-my:object");
m_xsltArg.RemoveExtensionObject("urn:my-object ");
if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(expected);
return;
}
else
Assert.True(false);
}
示例15: RemoveExtObj6
public void RemoveExtObj6(object param)
{
string Baseline = "baseline\\" + (string)param;
MyObject obj = new MyObject(6, _output);
m_xsltArg = new XsltArgumentList();
///nonePermSet.PermitOnly(); ;
m_xsltArg.AddExtensionObject("urn:my-object", obj);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", 2);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", "Test String");
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", (double)5.1);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", true);
m_xsltArg.RemoveExtensionObject("urn:my-object");
m_xsltArg.AddExtensionObject("urn:my-object", false);
m_xsltArg.RemoveExtensionObject("urn:my-object");
///CodeAccessPermission.RevertPermitOnly();
if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1))
{
VerifyResult(Baseline, _strOutFile);
return;
}
else
Assert.True(false);
}