2 new revisions:
Revision: c63fbdf8c5f9
Branch: default
Author: azizatif
Date: Sun Jan 20 05:37:46 2013
Log: Using ContentType extensions from Mannex instead
http://code.google.com/p/fizzler/source/detail?r=c63fbdf8c5f9
Revision: 7cb79ffaa4aa
Branch: default
Author: azizatif
Date: Sun Jan 20 06:19:32 2013
Log: XML doc remark that HtmlDocument extension methods are exclusive
and m...
http://code.google.com/p/fizzler/source/detail?r=7cb79ffaa4aa
==============================================================================
Revision: c63fbdf8c5f9
Branch: default
Author: azizatif
Date: Sun Jan 20 05:37:46 2013
Log: Using ContentType extensions from Mannex instead
http://code.google.com/p/fizzler/source/detail?r=c63fbdf8c5f9
Deleted:
/VisualFizzler/ContentTypeExtensions.cs
Modified:
/VisualFizzler/MainForm.cs
/VisualFizzler/VisualFizzler.csproj
=======================================
--- /VisualFizzler/ContentTypeExtensions.cs Sat Jan 19 12:50:50 2013
+++ /dev/null
@@ -1,72 +0,0 @@
-#region Copyright and License
-//
-// Fizzler - CSS Selector Engine for Microsoft .NET Framework
-// Copyright (c) 2009 Atif Aziz, Colin Ramsay. 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 VisualFizzler
-{
- using System;
- using System.Net.Mime;
-
- internal static class ContentTypeExtensions
- {
- public static bool IsPlainText(this ContentType contentType)
- {
- if (contentType == null) throw new
ArgumentNullException("contentType");
- return EqualsOrdinalIgnoreCase(MediaTypeNames.Text.Plain,
contentType.MediaType);
- }
-
- public static bool IsText(this ContentType contentType)
- {
- if (contentType == null) throw new
ArgumentNullException("contentType");
- return EqualsOrdinalIgnoreCase("text",
GetMediaBaseType(contentType));
- }
-
- public static bool IsHtml(this ContentType contentType)
- {
- if (contentType == null) throw new
ArgumentNullException("contentType");
- return EqualsOrdinalIgnoreCase(MediaTypeNames.Text.Html,
contentType.MediaType);
- }
-
- public static bool IsImage(this ContentType contentType)
- {
- if (contentType == null) throw new
ArgumentNullException("contentType");
- return EqualsOrdinalIgnoreCase("image",
GetMediaBaseType(contentType));
- }
-
- public static string GetMediaBaseType(this ContentType contentType)
- {
- if (contentType == null) throw new
ArgumentNullException("contentType");
- var mediaType = contentType.MediaType;
- return mediaType.Substring(0, mediaType.IndexOf('/'));
- }
-
- public static string GetMediaSubType(this ContentType contentType)
- {
- if (contentType == null) throw new
ArgumentNullException("contentType");
- var mediaType = contentType.MediaType;
- return mediaType.Substring(mediaType.IndexOf('/') + 1);
- }
-
- private static bool EqualsOrdinalIgnoreCase(string left, string
right)
- {
- return left.Equals(right, StringComparison.OrdinalIgnoreCase);
- }
- }
-}
=======================================
--- /VisualFizzler/MainForm.cs Sat Jan 19 12:50:50 2013
+++ /VisualFizzler/MainForm.cs Sun Jan 20 05:37:46 2013
@@ -37,6 +37,7 @@
using Fizzler.Systems.HtmlAgilityPack;
using HtmlAgilityPack;
using Mannex.Net;
+ using Mannex.Net.Mime;
using Microsoft.VisualBasic;
using OpenWebClient;
using HtmlDocument = HtmlAgilityPack.HtmlDocument;
=======================================
--- /VisualFizzler/VisualFizzler.csproj Thu Jan 17 15:22:04 2013
+++ /VisualFizzler/VisualFizzler.csproj Sun Jan 20 05:37:46 2013
@@ -60,7 +60,6 @@
<Compile Include="..\Common\SolutionInfo.cs">
<Link>SolutionInfo.cs</Link>
</Compile>
- <Compile Include="ContentTypeExtensions.cs" />
<Compile Include="CursorScope.cs" />
<Compile Include="ISingletonScopeHelper.cs" />
<Compile Include="MainForm.cs">
==============================================================================
Revision: 7cb79ffaa4aa
Branch: default
Author: azizatif
Date: Sun Jan 20 06:19:32 2013
Log: XML doc remark that HtmlDocument extension methods are exclusive
and may be removed in the future
http://code.google.com/p/fizzler/source/detail?r=7cb79ffaa4aa
Modified:
/Fizzler.Systems.HtmlAgilityPack/HtmlDocumentExtensions.cs
=======================================
--- /Fizzler.Systems.HtmlAgilityPack/HtmlDocumentExtensions.cs Sat Jan 19
14:33:02 2013
+++ /Fizzler.Systems.HtmlAgilityPack/HtmlDocumentExtensions.cs Sun Jan 20
06:19:32 2013
@@ -39,11 +39,14 @@
{
private static Dictionary<string, HtmlElementFlag>
_defaultElementFlags;
- // TODO Think of a better name than LoadHtml2
/// <summary>
/// Same as <see cref="HtmlDocument.LoadHtml" /> but without the
FORM nesting
/// problem outlined in <a
href="
http://code.google.com/p/fizzler/issues/detail?id=24">issue #24</a>.
/// </summary>
+ /// <remarks>
+ /// This method is designed to be used by the Fizzler project tools
+ /// exclusively and may be removed from a future version.
+ /// </remarks>
public static void LoadHtml2(this HtmlDocument document, string
html)
{
@@ -51,11 +54,14 @@
document.LoadHtmlWithElementFlags(html, DefaultElementFlags);
}
- // TODO Think of a better name than LoadHtml2
/// <summary>
/// Same as <see cref="HtmlDocument.Load(string)" /> but without
the FORM nesting
/// problem outlined in <a
href="
http://code.google.com/p/fizzler/issues/detail?id=24">issue #24</a>.
/// </summary>
+ /// <remarks>
+ /// This method is designed to be used by the Fizzler project tools
+ /// exclusively and may be removed from a future version.
+ /// </remarks>
public static void Load2(this HtmlDocument document, string path)
{
@@ -72,6 +78,10 @@
/// and is primarily a hack around <see
cref="HtmlNode.ElementsFlags"/>
/// being static.
/// </remarks>
+ /// <remarks>
+ /// This method is designed to be used by the Fizzler project tools
+ /// exclusively and may be removed from a future version.
+ /// </remarks>
[MethodImpl(MethodImplOptions.Synchronized)]
public static void LoadHtmlWithElementFlags(this HtmlDocument
document, string html, IEnumerable<KeyValuePair<string, HtmlElementFlag>>
flags)
@@ -89,6 +99,10 @@
/// and is primarily a hack around <see
cref="HtmlNode.ElementsFlags"/>
/// being static.
/// </remarks>
+ /// <remarks>
+ /// This method is designed to be used by the Fizzler project tools
+ /// exclusively and may be removed from a future version.
+ /// </remarks>
[MethodImpl(MethodImplOptions.Synchronized)]
public static void LoadWithElementFlags(this HtmlDocument
document, string path, IEnumerable<KeyValuePair<string, HtmlElementFlag>>
flags)