[jayrock] push by azizatif - Removed ControlExporter so Jayrock.Json can be used in client profiles on 2011-04-30 09:49 GMT

3 views
Skip to first unread message

jay...@googlecode.com

unread,
Apr 30, 2011, 5:50:32 AM4/30/11
to jayrock...@googlegroups.com
Revision: e5d380834c4a
Author: azizatif
Date: Sat Apr 30 02:49:12 2011
Log: Removed ControlExporter so Jayrock.Json can be used in client
profiles
http://code.google.com/p/jayrock/source/detail?r=e5d380834c4a

Deleted:
/src/Jayrock.Json/Json/Conversion/Converters/ControlExporter.cs
/tests/Jayrock/Json/Conversion/Converters/TestControlExporter.cs
Modified:
/nant.build
/src/Jayrock.Json/Jayrock.Json.csproj
/src/Jayrock.Json/Json/Conversion/ExportContext.cs
/tests/Jayrock/Jayrock.Tests.csproj
/tests/Jayrock/Json/Conversion/TestExportContext.cs

=======================================
--- /src/Jayrock.Json/Json/Conversion/Converters/ControlExporter.cs Fri Apr
15 16:09:54 2011
+++ /dev/null
@@ -1,86 +0,0 @@
-#region License, Terms and Conditions
-//
-// Jayrock - JSON and JSON-RPC for Microsoft .NET Framework and Mono
-// Written by Atif Aziz (www.raboof.com)
-// Copyright (c) 2005 Atif Aziz. All rights reserved.
-//
-// This library is free software; you can redistribute it and/or modify it
under
-// the terms of the GNU Lesser General Public License as published by the
Free
-// Software Foundation; either version 3 of the License, or (at your
option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful, but
WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
-// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more
-// details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this library; if not, write to the Free Software Foundation,
Inc.,
-// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-#endregion
-
-namespace Jayrock.Json.Conversion.Converters
-{
- #region Imports
-
- using System;
- using System.Diagnostics;
- using System.IO;
- using System.Web;
- using System.Web.UI;
-
- #endregion
-
- public sealed class ControlExporter : ExporterBase
- {
- public ControlExporter() :
- this(typeof(Control)) {}
-
- public ControlExporter(Type inputType) :
- base(inputType) {}
-
- protected override void ExportValue(ExportContext context, object
value, JsonWriter writer)
- {
- Debug.Assert(context != null);
- Debug.Assert(value != null);
- Debug.Assert(writer != null);
-
- ExportControl((Control) value, writer);
- }
-
- private static void ExportControl(Control control, JsonWriter
writer)
- {
- Debug.Assert(control != null);
- Debug.Assert(writer != null);
-
- StringWriter stringWriter = new StringWriter();
- HtmlTextWriter htmlWriter = GetHtmlWriter(stringWriter);
- control.RenderControl(htmlWriter);
- writer.WriteString(stringWriter.ToString());
- }
-
- private static HtmlTextWriter GetHtmlWriter(TextWriter innerWriter)
- {
- Debug.Assert(innerWriter != null);
-
- //
- // If there is an HTTP context lying around then use the HTML
writer
- // from there. Otherwise create the base implementation.
- //
-
- HttpContext context = HttpContext.Current;
-
- if (context != null)
- {
- Type htmlWriterType = context.Request.Browser.TagWriter;
- return (HtmlTextWriter)
Activator.CreateInstance(htmlWriterType, new object[] { innerWriter });
- }
- else
- {
- return new HtmlTextWriter(innerWriter);
- }
- }
- }
-
-}
=======================================
--- /tests/Jayrock/Json/Conversion/Converters/TestControlExporter.cs Fri
Apr 15 16:09:54 2011
+++ /dev/null
@@ -1,47 +0,0 @@
-#region License, Terms and Conditions
-//
-// Jayrock - A JSON-RPC implementation for the Microsoft .NET Framework
-// Written by Atif Aziz (www.raboof.com)
-// Copyright (c) Atif Aziz. All rights reserved.
-//
-// This library is free software; you can redistribute it and/or modify it
under
-// the terms of the GNU Lesser General Public License as published by the
Free
-// Software Foundation; either version 3 of the License, or (at your
option)
-// any later version.
-//
-// This library is distributed in the hope that it will be useful, but
WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
-// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more
-// details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this library; if not, write to the Free Software Foundation,
Inc.,
-// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-#endregion
-
-namespace Jayrock.Json.Conversion.Converters
-{
- #region Imports
-
- using System.Web.UI.HtmlControls;
- using NUnit.Framework;
-
- #endregion
-
- [ TestFixture ]
- public class TestControlExporter
- {
- [ Test ]
- public void Export()
- {
- ControlExporter exporter = new ControlExporter();
- JsonTextWriter writer = new JsonTextWriter();
- HtmlGenericControl span = new HtmlGenericControl("span");
- span.InnerText = "Happy & shiny people!";
- exporter.Export(new ExportContext(), span, writer);
- Assert.AreEqual("[\"<span>Happy &amp; shiny
people!<\\/span>\"]", writer.ToString());
- }
- }
-}
-
=======================================
--- /nant.build Fri Apr 15 16:09:54 2011
+++ /nant.build Sat Apr 30 02:49:12 2011
@@ -261,7 +261,6 @@
<include name="System.Data.dll" />
<include name="System.Numerics.dll" />
<include name="System.Xml.dll" />
- <include name="System.Web.dll" />
</references>
<nowarn>
<warning number="618" />
@@ -343,7 +342,6 @@
<include name="System.Numerics.dll" />
<include name="System.Xml.dll" />
<include name="System.Web.dll" />
- <include name="System.Web.dll" />
<include name="${jayrock.json.dll.path}" />
<include name="${jayrock.dll.path}" />
<include
name="${path::combine(nunit.dir.path, 'nunit.framework.dll')}" />
=======================================
--- /src/Jayrock.Json/Jayrock.Json.csproj Thu Apr 21 16:35:33 2011
+++ /src/Jayrock.Json/Jayrock.Json.csproj Sat Apr 30 02:49:12 2011
@@ -30,7 +30,7 @@
</UpgradeBackupLocation>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile />
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -100,9 +100,6 @@
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Numerics" />
- <Reference Include="System.Web">
- <Name>System.Web</Name>
- </Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
@@ -185,9 +182,6 @@
<Compile Include="Json\Conversion\Converters\ComponentImporter.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Json\Conversion\Converters\ControlExporter.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Json\Conversion\Converters\DataRowExporter.cs">
<SubType>Code</SubType>
</Compile>
=======================================
--- /src/Jayrock.Json/Json/Conversion/ExportContext.cs Thu Apr 21 16:38:50
2011
+++ /src/Jayrock.Json/Json/Conversion/ExportContext.cs Sat Apr 30 02:49:12
2011
@@ -211,7 +211,6 @@
exporters.Add(new DataTableExporter());
exporters.Add(new DataRowExporter());
exporters.Add(new DbDataRecordExporter());
- exporters.Add(new ControlExporter());
exporters.Add(new StringExporter(typeof(Uri)));
exporters.Add(new StringExporter(typeof(Guid)));

=======================================
--- /tests/Jayrock/Jayrock.Tests.csproj Thu Apr 21 16:35:33 2011
+++ /tests/Jayrock/Jayrock.Tests.csproj Sat Apr 30 02:49:12 2011
@@ -155,9 +155,6 @@
<Compile Include="Json\Conversion\Converters\TestComponentImporter.cs">
<SubType>Code</SubType>
</Compile>
- <Compile Include="Json\Conversion\Converters\TestControlExporter.cs">
- <SubType>Code</SubType>
- </Compile>
<Compile Include="Json\Conversion\Converters\TestDataSetExporter.cs" />
<Compile Include="Json\Conversion\Converters\TestDataTableExporter.cs"
/>
<Compile Include="Json\Conversion\Converters\TestDateTimeExporter.cs">
=======================================
--- /tests/Jayrock/Json/Conversion/TestExportContext.cs Fri Apr 29 13:07:31
2011
+++ /tests/Jayrock/Json/Conversion/TestExportContext.cs Sat Apr 30 02:49:12
2011
@@ -60,9 +60,6 @@
AssertInStock(typeof(ExportAwareExporter), typeof(JsonArray));
AssertInStock(typeof(EnumerableExporter), typeof(ArrayList));
AssertInStock(typeof(ExportAwareExporter),
typeof(ExportableThing));
- AssertInStock(typeof(ControlExporter), typeof(Control));
- AssertInStock(typeof(ControlExporter), typeof(HtmlControl));
- AssertInStock(typeof(ControlExporter), typeof(HtmlImage));
AssertInStock(typeof(DataSetExporter), typeof(DataSet));
AssertInStock(typeof(DataSetExporter), typeof(MyDataSet));
AssertInStock(typeof(DataTableExporter), typeof(DataTable));

Reply all
Reply to author
Forward
0 new messages