Update of /cvsroot/phpslash/phpslash-dev/public_html/scripts/fckeditor/_aspnet/FredCK.FCKeditorV2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12486/phpslash-dev/public_html/scripts/fckeditor/_aspnet/FredCK.FCKeditorV2
Added Files:
AssemblyInfo.cs FCKeditor.cs FCKeditorConfigurations.cs
FCKeditorDesigner.cs FileBrowserConnector.cs
FredCK.FCKeditorV2.FxCop FredCK.FCKeditorV2.csproj
FredCK.FCKeditorV2.csproj.user FredCK.FCKeditorV2.snk
XmlUtil.cs
Log Message:
complete fckeditor addition
--- NEW FILE: AssemblyInfo.cs ---
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security.Permissions ;
using System.Web.UI ;
[assembly:TagPrefix("FredCK.FCKeditorV2", "FCKeditorV2")]
[assembly:System.CLSCompliant(true)]
[assembly:System.Runtime.InteropServices.ComVisible(false)]
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(@"..\..\FredCK.FCKeditorV2.snk")]
[assembly: AssemblyKeyName("")]
--- NEW FILE: FCKeditor.cs ---
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: FCKeditor.cs
* This is the FCKeditor Asp.Net control.
*
* Version: 2.0 Beta 2
* Modified: 2004-05-31 23:17:23
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
*/
using System ;
using System.Web.UI ;
using System.Web.UI.WebControls ;
using System.ComponentModel ;
using System.Text.RegularExpressions ;
using System.Globalization ;
using System.Security.Permissions ;
namespace FredCK.FCKeditorV2
{
// [ System.Web.AspNetHostingPermission(SecurityAction.LinkDemand) ]
[ DefaultProperty("Value") ]
[ ValidationProperty("Value") ]
[ ToolboxData("<{0}:FCKeditor runat=server></{0}:FCKeditor>") ]
[ Designer("FredCK.FCKeditorV2.FCKeditorDesigner") ]
[ ParseChildren(false) ]
public class FCKeditor : System.Web.UI.Control, IPostBackDataHandler
{
private FCKeditorConfigurations oConfig ;
public FCKeditor()
{
oConfig = new FCKeditorConfigurations() ;
}
[ Browsable( false ) ]
public FCKeditorConfigurations Config
{
get { return oConfig ; }
}
[ DefaultValue( "" ) ]
public string Value
{
get { return (string)IsNull( ViewState["Value"], "" ) ; }
set { ViewState["Value"] = value ; }
}
[ DefaultValue( "/FCKeditor/" ) ]
public string BasePath
{
get { return (string)IsNull( ViewState["BasePath"], "" ) ; }
set { ViewState["BasePath"] = value ; }
}
[ DefaultValue( "Default" ) ]
public string ToolbarSet
{
get { return (string)IsNull( ViewState["ToolbarSet"], "Default" ) ; }
set { ViewState["ToolbarSet"] = value ; }
}
[ Category( "Appearence" ) ]
[ DefaultValue( "100%" ) ]
public Unit Width
{
get { return (Unit)IsNull( ViewState["Width"], Unit.Parse("100%", CultureInfo.InvariantCulture) ) ; }
set { ViewState["Width"] = value ; }
}
[ Category("Appearence") ]
[ DefaultValue( "200px" ) ]
public Unit Height
{
get { return (Unit)IsNull( ViewState["Height"], Unit.Parse("200px", CultureInfo.InvariantCulture) ) ; }
set { ViewState["Height"] = value ; }
}
public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
{
if (postCollection[postDataKey] != Value)
{
Value = postCollection[postDataKey];
return true;
}
return false;
}
public bool CheckBrowserCompatibility()
{
System.Web.HttpBrowserCapabilities oBrowser = Page.Request.Browser ;
// Internet Explorer 5.5+ for Windows
if (oBrowser.Browser == "IE" && ( oBrowser.MajorVersion >= 6 || ( oBrowser.MajorVersion == 5 && oBrowser.MinorVersion >= 5 ) ) && oBrowser.Win32)
return true ;
else
{
Match oMatch = Regex.Match( this.Page.Request.UserAgent, @"(?<=Gecko/)\d{8}" ) ;
return ( oMatch.Success && int.Parse( oMatch.Value, CultureInfo.InvariantCulture ) >= 20030210 ) ;
}
}
protected override void Render(HtmlTextWriter writer)
{
writer.Write( "<div>" ) ;
if ( this.CheckBrowserCompatibility() )
{
string sLink = this.BasePath + "editor/fckeditor.html?InstanceName=" + this.UniqueID ;
if ( this.ToolbarSet.Length > 0 ) sLink += "&Toolbar=" + this.ToolbarSet ;
// Render the linked hidden field.
writer.Write(
"<input type=\"hidden\" id=\"{0}\" name=\"{0}\" value=\"{1}\">",
this.UniqueID,
System.Web.HttpUtility.HtmlEncode( this.Value ) ) ;
// Render the configurations hidden field.
writer.Write(
"<input type=\"hidden\" id=\"{0}___Config\" value=\"{1}\">",
this.UniqueID,
this.Config.GetHiddenFieldString() ) ;
// Render the editor IFRAME.
writer.Write(
"<iframe id=\"{0}___Frame\" src=\"{1}\" width=\"{2}\" height=\"{3}\" frameborder=\"no\" scrolling=\"no\"></iframe>",
this.UniqueID,
sLink,
this.Width,
this.Height ) ;
}
else
{
writer.Write(
"<textarea name=\"{0}\" rows=\"4\" cols=\"40\" style=\"width: {1}; height: {2}\" wrap=\"virtual\">{3}</textarea>",
this.UniqueID,
this.Width,
this.Height,
System.Web.HttpUtility.HtmlEncode( this.Value ) ) ;
}
writer.Write( "</div>" ) ;
}
public void RaisePostDataChangedEvent()
{
// Do nothing
}
private object IsNull( object valueToCheck, object replacementValue )
{
return valueToCheck == null ? replacementValue : valueToCheck ;
}
}
}
--- NEW FILE: FCKeditorConfigurations.cs ---
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: FCKeditorConfigurations.cs
* Class that holds all editor configurations.
*
* Version: 2.0 Beta 2
* Modified: 2004-05-31 23:17:23
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
*/
using System ;
using System.Collections ;
namespace FredCK.FCKeditorV2
{
public class FCKeditorConfigurations
{
private Hashtable colConfigs ;
internal FCKeditorConfigurations()
{
colConfigs = new Hashtable() ;
}
public string this[ string configurationName ]
{
get
{
if ( colConfigs.ContainsKey( configurationName ) )
return (string)colConfigs[ configurationName ] ;
else
return null ;
}
set
{
colConfigs[ configurationName ] = value ;
}
}
internal string GetHiddenFieldString()
{
System.Text.StringBuilder osParams = new System.Text.StringBuilder() ;
foreach ( DictionaryEntry oEntry in colConfigs )
{
if ( osParams.Length > 0 )
osParams.Append( '&' ) ;
osParams.AppendFormat( "{0}={1}", System.Web.HttpUtility.HtmlEncode( oEntry.Key.ToString() ), System.Web.HttpUtility.HtmlEncode( oEntry.Value.ToString() ) ) ;
}
return osParams.ToString() ;
}
}
}
--- NEW FILE: FCKeditorDesigner.cs ---
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: FCKeditorDesigner.cs
* The EditorDesigner class defines the editor visualization at design
* time.
*
* Version: 2.0 Beta 2
* Modified: 2004-05-31 23:17:24
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
*/
using System ;
using System.Globalization ;
namespace FredCK.FCKeditorV2
{
public class FCKeditorDesigner : System.Web.UI.Design.ControlDesigner
{
public FCKeditorDesigner()
{
}
public override string GetDesignTimeHtml()
{
FCKeditor oControl = (FCKeditor)Component ;
return String.Format( CultureInfo.InvariantCulture,
"<div><table width=\"{0}\" height=\"{1}\" bgcolor=\"#f5f5f5\" bordercolor=\"#c7c7c7\" cellpadding=\"0\" cellspacing=\"0\" border=\"1\"><tr><td valign=\"middle\" align=\"center\">FCKeditor V2 - <b>{2}</b></td></tr></table></div>",
oControl.Width,
oControl.Height,
oControl.ID ) ;
}
}
}
--- NEW FILE: FileBrowserConnector.cs ---
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: FileBrowserConnector.cs
* This is the code behind of the connector.aspx page used by the
* File Browser.
*
* Version: 2.0 Beta 2
* Modified: 2004-05-31 23:17:24
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
*/
using System ;
using System.Globalization ;
using System.Xml ;
using System.Web ;
namespace FredCK.FCKeditorV2
{
public class FileBrowserConnector : System.Web.UI.Page
{
private const string DEFAULT_USER_FILES_PATH = "/UserFiles/" ;
private string sUserFilesPath ;
private string sUserFilesDirectory ;
protected override void OnLoad(EventArgs e)
{
// Get the main request informaiton.
string sCommand = Request.QueryString["Command"] ;
if ( sCommand == null ) return ;
string sResourceType = Request.QueryString["Type"] ;
if ( sResourceType == null ) return ;
string sCurrentFolder = Request.QueryString["CurrentFolder"] ;
if ( sCurrentFolder == null ) return ;
// Check the current folder syntax (must begin and start with a slash).
if ( ! sCurrentFolder.EndsWith( "/" ) )
sCurrentFolder += "/" ;
if ( ! sCurrentFolder.StartsWith( "/" ) )
sCurrentFolder = "/" + sCurrentFolder ;
// File Upload doesn't have to return XML, so it must be intercepted before anything.
if ( sCommand == "FileUpload" )
{
this.FileUpload( sResourceType, sCurrentFolder ) ;
return ;
}
// Cleans the response buffer.
Response.ClearHeaders() ;
Response.Clear() ;
// Prevent the browser from caching the result.
Response.CacheControl = "no-cache" ;
// Set the response format.
Response.ContentEncoding = System.Text.UTF8Encoding.UTF8 ;
Response.ContentType = "text/xml" ;
XmlDocument oXML = new XmlDocument() ;
XmlNode oConnectorNode = CreateBaseXml( oXML, sCommand, sResourceType, sCurrentFolder ) ;
// Execute the required command.
switch( sCommand )
{
case "GetFolders" :
this.GetFolders( oConnectorNode, sResourceType, sCurrentFolder ) ;
break ;
case "GetFoldersAndFiles" :
this.GetFolders( oConnectorNode, sResourceType, sCurrentFolder ) ;
this.GetFiles( oConnectorNode, sResourceType, sCurrentFolder ) ;
break ;
case "CreateFolder" :
this.CreateFolder( oConnectorNode, sResourceType, sCurrentFolder ) ;
break ;
}
// Output the resulting XML.
Response.Write( oXML.OuterXml ) ;
Response.End() ;
}
#region Base XML Creation
private XmlNode CreateBaseXml( XmlDocument xml, string command, string resourceType, string currentFolder )
{
// Create the XML document header.
xml.AppendChild( xml.CreateXmlDeclaration( "1.0", "utf-8", null ) ) ;
// Create the main "Connector" node.
XmlNode oConnectorNode = XmlUtil.AppendElement( xml, "Connector" ) ;
XmlUtil.SetAttribute( oConnectorNode, "command", command ) ;
XmlUtil.SetAttribute( oConnectorNode, "resourceType", resourceType ) ;
// Add the current folder node.
XmlNode oCurrentNode = XmlUtil.AppendElement( oConnectorNode, "CurrentFolder" ) ;
XmlUtil.SetAttribute( oCurrentNode, "path", currentFolder ) ;
XmlUtil.SetAttribute( oCurrentNode, "url", GetUrlFromPath( resourceType, currentFolder) ) ;
return oConnectorNode ;
}
#endregion
#region Command Handlers
private void GetFolders( XmlNode connectorNode, string resourceType, string currentFolder )
{
// Map the virtual path to the local server path.
string sServerDir = this.ServerMapFolder( resourceType, currentFolder ) ;
// Create the "Folders" node.
XmlNode oFoldersNode = XmlUtil.AppendElement( connectorNode, "Folders" ) ;
System.IO.DirectoryInfo oDir = new System.IO.DirectoryInfo( sServerDir ) ;
System.IO.DirectoryInfo[] aSubDirs = oDir.GetDirectories() ;
for ( int i = 0 ; i < aSubDirs.Length ; i++ )
{
// Create the "Folders" node.
XmlNode oFolderNode = XmlUtil.AppendElement( oFoldersNode, "Folder" ) ;
XmlUtil.SetAttribute( oFolderNode, "name", aSubDirs[i].Name ) ;
}
}
private void GetFiles( XmlNode connectorNode, string resourceType, string currentFolder )
{
// Map the virtual path to the local server path.
string sServerDir = this.ServerMapFolder( resourceType, currentFolder ) ;
// Create the "Files" node.
XmlNode oFilesNode = XmlUtil.AppendElement( connectorNode, "Files" ) ;
System.IO.DirectoryInfo oDir = new System.IO.DirectoryInfo( sServerDir ) ;
System.IO.FileInfo[] aFiles = oDir.GetFiles() ;
for ( int i = 0 ; i < aFiles.Length ; i++ )
{
long iFileSize = ( aFiles[i].Length / 1024 ) ;
if ( iFileSize < 1 ) iFileSize = 1 ;
// Create the "Folders" node.
XmlNode oFileNode = XmlUtil.AppendElement( oFilesNode, "File" ) ;
XmlUtil.SetAttribute( oFileNode, "name", aFiles[i].Name ) ;
XmlUtil.SetAttribute( oFileNode, "size", iFileSize.ToString( CultureInfo.InvariantCulture ) ) ;
}
}
private void CreateFolder( XmlNode connectorNode, string resourceType, string currentFolder )
{
string sErrorNumber = "0" ;
string sNewFolderName = Request.QueryString["NewFolderName"] ;
if ( sNewFolderName == null || sNewFolderName.Length == 0 )
sErrorNumber = "102" ;
else
{
// Map the virtual path to the local server path of the current folder.
string sServerDir = this.ServerMapFolder( resourceType, currentFolder ) ;
System.IO.DirectoryInfo oDir = new System.IO.DirectoryInfo( sServerDir ) ;
try
{
oDir.CreateSubdirectory( sNewFolderName ) ;
}
catch ( ArgumentException )
{
sErrorNumber = "102" ;
}
catch ( System.IO.PathTooLongException )
{
sErrorNumber = "102" ;
}
catch ( System.IO.IOException )
{
sErrorNumber = "101" ;
}
catch ( System.Security.SecurityException )
{
sErrorNumber = "103" ;
}
catch ( Exception )
{
sErrorNumber = "110" ;
}
}
// Create the "Error" node.
XmlNode oErrorNode = XmlUtil.AppendElement( connectorNode, "Error" ) ;
XmlUtil.SetAttribute( oErrorNode, "number", sErrorNumber ) ;
}
private void FileUpload( string resourceType, string currentFolder )
{
HttpPostedFile oFile = Request.Files["NewFile"] ;
string sErrorNumber = "0" ;
string sFileName = "" ;
if ( oFile != null )
{
// Map the virtual path to the local server path.
string sServerDir = this.ServerMapFolder( resourceType, currentFolder ) ;
// Get the uploaded file name.
sFileName = System.IO.Path.GetFileName( oFile.FileName ) ;
int iCounter = 0 ;
while ( true )
{
string sFilePath = System.IO.Path.Combine( sServerDir, sFileName ) ;
if ( System.IO.File.Exists( sFilePath ) )
{
iCounter++ ;
sFileName =
System.IO.Path.GetFileNameWithoutExtension( oFile.FileName ) +
"(" + iCounter + ")" +
System.IO.Path.GetExtension( oFile.FileName ) ;
sErrorNumber = "201" ;
}
else
{
oFile.SaveAs( sFilePath ) ;
break ;
}
}
}
else
sErrorNumber = "202" ;
Response.Clear() ;
Response.Write( "<script type=\"text/javascript\">" ) ;
Response.Write( "window.parent.frames['frmUpload'].OnUploadCompleted(" + sErrorNumber + ",'" + sFileName.Replace( "'", "\\'" ) + "') ;" ) ;
Response.Write( "</script>" ) ;
Response.End() ;
}
#endregion
#region Directory Mapping
private string ServerMapFolder( string resourceType, string folderPath )
{
// Get the resource type directory.
string sResourceTypePath = System.IO.Path.Combine( this.UserFilesDirectory, resourceType ) ;
// Ensure that the directory exists.
System.IO.Directory.CreateDirectory( sResourceTypePath ) ;
// Return the resource type directory combined with the required path.
return System.IO.Path.Combine( sResourceTypePath, folderPath.TrimStart('/') ) ;
}
private string GetUrlFromPath( string resourceType, string folderPath )
{
return this.UserFilesPath + resourceType + folderPath ;
}
private string UserFilesPath
{
get
{
if ( sUserFilesPath == null )
{
// Try to get the User Files path from the Web.config file.
sUserFilesPath = System.Configuration.ConfigurationSettings.AppSettings["FCKeditor:UserFilesPath"] ;
// If it was not set in the Web.config file then use the default value.
if ( sUserFilesPath == null || UserFilesPath.Length == 0 )
sUserFilesPath = DEFAULT_USER_FILES_PATH ;
// Check that the user path ends with slash ("/")
if ( ! sUserFilesPath.EndsWith("/") )
sUserFilesPath += "/" ;
}
return sUserFilesPath ;
}
}
private string UserFilesDirectory
{
get
{
if ( sUserFilesDirectory == null )
{
// Get the local (server) directory path translation.
sUserFilesDirectory = Server.MapPath( this.UserFilesPath ) ;
}
return sUserFilesDirectory ;
}
}
#endregion
}
}
--- NEW FILE: FredCK.FCKeditorV2.FxCop ---
<?xml version="1.0" encoding="utf-8"?>
<FxCopProject Version="1.3" Name="FCKeditor V2">
<ProjectOptions>
<SharedProject>False</SharedProject>
<Stylesheet Apply="False">c:\program files\microsoft fxcop 1.21\Xml\FxCopReport.xsl</Stylesheet>
<SaveMessages>
<Project Status="Active, Excluded" NewOnly="False" />
<Report Status="Active" NewOnly="False" />
</SaveMessages>
<ProjectFile Compress="True" DefaultTargetCheck="True" DefaultRuleCheck="True" SaveByRuleGroup="" Deterministic="False" />
<PermitAnalysis>True</PermitAnalysis>
<SourceLookup>True</SourceLookup>
<AnalysisExceptionsThreshold>100</AnalysisExceptionsThreshold>
<RuleExceptionsThreshold>10</RuleExceptionsThreshold>
<Spelling Locale="en-us" />
</ProjectOptions>
<Targets>
<Target Name="bin\Debug\FredCK.FCKeditorV2.dll" Analyze="True" AnalyzeAllChildren="True" />
</Targets>
<Rules>
<RuleFiles>
<RuleFile Name="$(FxCopDir)\Rules\PerformanceRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\ComRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\UsageRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\SecurityRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\DesignRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\GlobalizationRules.dll" Enabled="True" AllRulesEnabled="True" />
<RuleFile Name="$(FxCopDir)\Rules\NamingRules.dll" Enabled="True" AllRulesEnabled="True" />
</RuleFiles>
<Groups />
<Settings />
</Rules>
<FxCopReport Version="1.3" LastAnalysis="2004-05-27 17:07:20Z">
<Namespaces>
<Namespace Name="FredCK.FCKeditorV2">
<Messages>
<Message ID="Keditor" Status="Excluded" Created="2004-01-14 00:37:50Z">
<Rule TypeName="NamespaceNamesShouldBeSpelledCorrectly" />
<Issues>
<Issue Certainty="50" Level="CriticalWarning">
<Resolution>
<Data>
<Items>
<Item>FredCK.FCKeditorV2</Item>
<Item>Keditor</Item>
</Items>
</Data>
</Resolution>
</Issue>
</Issues>
<Notes>
<User Name="fredck">
<Note ID="3" />
</User>
</Notes>
</Message>
</Messages>
</Namespace>
</Namespaces>
<Targets>
<Target Name="bin\Debug\FredCK.FCKeditorV2.dll">
<Messages>
<Message Status="Active" Created="2004-05-19 14:38:32Z">
<Rule TypeName="AssembliesHavePermissionRequests" />
<Issues>
<Issue Certainty="99" Level="CriticalError">
<Resolution>
<Data>
<Items>
<Item>FredCK.FCKeditorV2</Item>
</Items>
</Data>
</Resolution>
</Issue>
</Issues>
</Message>
</Messages>
<Modules>
<Module Name="fredck.fckeditorv2.dll">
<Namespaces>
<Namespace Name="FredCK.FCKeditorV2">
<Classes>
<Class Name="Editor">
<Methods>
<Method Name="Render(System.Web.UI.HtmlTextWriter):System.Void">
<Messages>
<Message Status="Active" Created="2004-05-19 14:48:27Z">
<Rule TypeName="VirtualMethodsAndOverridesRequireSameLinkDemands" />
<Issues>
<Issue Certainty="33" Level="CriticalError">
<SourceCode Path="D:\Work\FCKEditor\www\FCKeditor.V2\_aspnet\FredCK.FCKeditorV2" File="Editor.cs" Line="102" />
<Resolution>
<Data>
<Items>
<Item>Render</Item>
<Item>Render</Item>
<Item>Control</Item>
</Items>
</Data>
</Resolution>
</Issue>
</Issues>
</Message>
</Messages>
</Method>
<Method Name="RaisePostDataChangedEvent():System.Void">
<Messages>
<Message Status="Active" Created="2004-05-19 14:48:27Z">
<Rule TypeName="EventsShouldBeUsed" />
<Issues>
<Issue Certainty="75" Level="Warning">
<SourceCode Path="D:\Work\FCKEditor\www\FCKeditor.V2\_aspnet\FredCK.FCKeditorV2" File="Editor.cs" Line="141" />
<Resolution>
<Data>
<Items>
<Item>RaisePostDataChangedEvent</Item>
</Items>
</Data>
</Resolution>
</Issue>
</Issues>
</Message>
</Messages>
</Method>
</Methods>
</Class>
<Class Name="FileBrowserConnector">
<Methods>
<Method Name="CreateFolder(System.Xml.XmlNode,System.String,System.String):System.Void">
<Messages>
<Message Status="Excluded" Created="2004-05-27 17:07:20Z">
<Rule TypeName="ExceptionAndSystemExceptionTypesAreNotCaught" />
<Issues>
<Issue Certainty="95" Level="CriticalError">
<SourceCode Path="D:\Work\FCKEditor\www\FCKeditor.V2\_aspnet\FredCK.FCKeditorV2" File="FileBrowserConnector.cs" Line="185" />
<Resolution>
<Data>
<Items>
<Item>CreateFolder</Item>
<Item>Exception</Item>
</Items>
</Data>
</Resolution>
</Issue>
</Issues>
<Notes>
<User Name="fredck">
<Note ID="1" />
</User>
</Notes>
</Message>
</Messages>
</Method>
</Methods>
</Class>
<Class Name="FCKeditorConfigurations">
<Messages>
<Message ID="Keditor" Status="Excluded" Created="2004-05-27 17:05:04Z">
<Rule TypeName="TypeNamesShouldBeSpelledCorrectly" />
<Issues>
<Issue Certainty="75" Level="CriticalWarning">
<Resolution>
<Data>
<Items>
<Item>FCKeditorConfigurations</Item>
<Item>Keditor</Item>
</Items>
</Data>
</Resolution>
</Issue>
</Issues>
<Notes>
<User Name="fredck">
<Note ID="2" />
</User>
</Notes>
</Message>
</Messages>
</Class>
</Classes>
</Namespace>
</Namespaces>
</Module>
</Modules>
</Target>
</Targets>
<Notes>
<User Name="fredck">
<Note ID="1" Modified="2004-05-27 17:08:08Z">The exception is handled in the right way in this case.</Note>
<Note ID="2" Modified="2004-05-27 17:08:48Z">FxCop was confused with the editor name.</Note>
<Note ID="3" Modified="2004-05-27 17:12:26Z">FxCop was confused with the editor name.</Note>
</User>
</Notes>
<Rules>
<Rule TypeName="AssembliesHavePermissionRequests">
<Name>Assemblies specify permission requests</Name>
<Description>Permission requests prevent security exceptions from being thrown after code in an assembly has already begun executing. With permission requests, the assembly does not load if it has insufficient permissions. This rule will fire if you have specified a permission request incorrectly, or incompletely. If you have specified requests but FxCop reports a violation for this rule, use the PermView.exe tool to view the security permissions in the assembly. An unenforceable permission appears as an empty permission set.</Description>
<LongDescription>You should add attributes specifying what permissions your assembly will demand, might demand, and what permissions it does not want granted. For example, the following attribute indicates that an assembly will, at minimum, require read access to the USERNAME environment variable: [assembly:EnvironmentPermissionAttribute(SecurityAction.RequestMinimum,
Read="USERNAME")]. To specify permissions that the assembly might demand, use SecurityAction.RequestOptional. To specify permissions that the assembly must not be granted, use SecurityAction.RequestRefuse.</LongDescription>
<GroupOwner>MS FxCopDev</GroupOwner>
<DevOwner />
<Url>http://www.gotdotnet.com/team/fxcop/docs/rules/UsageRules/AssembliesPermissionRequests.html</Url>
<Email>ask...@mi...</Email>
<MessageLevel Certainty="99">CriticalError</MessageLevel>
<File Name="UsageRules.dll" Version="1.30.0.0" />
</Rule>
<Rule TypeName="EventsShouldBeUsed">
<Name>The .NET event model should be used whenever appropriate</Name>
<Description>A method name suggestive of event functionality was encountered.</Description>
<LongDescription />
<GroupOwner>MS FxCopDev</GroupOwner>
<DevOwner />
<Url>http://www.gotdotnet.com/team/fxcop/docs/rules/DesignRules/EventsShouldBeUsed.html</Url>
<Email>ask...@mi...</Email>
<MessageLevel Certainty="75">Warning</MessageLevel>
<File Name="DesignRules.dll" Version="1.30.0.0" />
</Rule>
<Rule TypeName="ExceptionAndSystemExceptionTypesAreNotCaught">
<Name>System.Exception and System.SystemException are not caught</Name>
<Description>You should not catch Exception or SystemException.</Description>
<LongDescription>Catching generic exception types can hide run-time problems from the library user, and can complicate debugging. You should catch only those exceptions that you can handle gracefully.</LongDescription>
<GroupOwner>MS FxCopDev</GroupOwner>
<DevOwner />
<Url>http://www.gotdotnet.com/team/fxcop/docs/rules/DesignRules/ExceptionAndSystemException.html</Url>
<Email>ask...@mi...</Email>
<MessageLevel Certainty="95">CriticalError</MessageLevel>
<File Name="DesignRules.dll" Version="1.30.0.0" />
</Rule>
<Rule TypeName="NamespaceNamesShouldBeSpelledCorrectly">
<Name>Namespace names should consist of correctly spelled words</Name>
<Description>The individual words that make up a namespace should not be abbreviated and should be spelled correctly.</Description>
<LongDescription>If this rule generates a false positive on a term that should be recognized, add the word to the FxCop custom dictionary.</LongDescription>
<GroupOwner>MS FxCopDev</GroupOwner>
<DevOwner />
<Url>http://www.gotdotnet.com/team/fxcop/docs/rules/UsageRules/NamespaceSpelling.html</Url>
<Email>ask...@mi...</Email>
<MessageLevel Certainty="50">CriticalWarning</MessageLevel>
<File Name="UsageRules.dll" Version="1.30.0.0" />
</Rule>
<Rule TypeName="TypeNamesShouldBeSpelledCorrectly">
<Name>Type names should consist of correctly spelled words</Name>
<Description>The individual words that make up a type name should not be abbreviated and should be spelled correctly.</Description>
<LongDescription>If this rule generates a false positive on a term that should be recognized, add the word to the FxCop custom dictionary.</LongDescription>
<GroupOwner>MS FxCopDev</GroupOwner>
<DevOwner />
<Url>http://www.gotdotnet.com/team/fxcop/docs/rules/UsageRules/TypeSpelling.html</Url>
<Email>ask...@mi...</Email>
<MessageLevel Certainty="75">CriticalWarning</MessageLevel>
<File Name="UsageRules.dll" Version="1.30.0.0" />
</Rule>
<Rule TypeName="VirtualMethodsAndOverridesRequireSameLinkDemands">
<Name>Virtual methods and their overrides require the same LinkDemand status</Name>
<Description>If a virtual method has a LinkDemand, in many cases, so should any override of it, and if an override has a LinkDemand, so should the overridden virtual method.</Description>
<LongDescription>As it is possible to call any of the overrides of a virtual method explicitly, they should all have the same LinkDemand status or, if not, should be reviewed. This also applies to LinkDemand security checks for methods that part of an interface implementation, because the caller might use an interface-typed reference to access the method.</LongDescription>
<GroupOwner>MS FxCopDev</GroupOwner>
<DevOwner />
<Url>http://www.gotdotnet.com/team/fxcop/docs/rules/SecurityRules/VirtualMethodsAndOverrides.html</Url>
<Email>ask...@mi...</Email>
<MessageLevel Certainty="33">CriticalError</MessageLevel>
<File Name="SecurityRules.dll" Version="1.30.0.0" />
</Rule>
</Rules>
</FxCopReport>
</FxCopProject>
--- NEW FILE: FredCK.FCKeditorV2.csproj ---
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{F6F32704-97E0-4006-A474-5A9729C6B1B4}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "FredCK.FCKeditorV2"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "FredCK.FCKeditorV2"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
<Reference
Name = "System.Design"
AssemblyName = "System.Design"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Design.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "System.Web"
AssemblyName = "System.Web"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Web.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "FCKeditor.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "FCKeditorConfigurations.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "FCKeditorDesigner.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "FileBrowserConnector.cs"
SubType = "ASPXCodeBehind"
BuildAction = "Compile"
/>
<File
RelPath = "FredCK.FCKeditorV2.FxCop"
BuildAction = "None"
/>
<File
RelPath = "FredCK.FCKeditorV2.snk"
BuildAction = "None"
/>
<File
RelPath = "XmlUtil.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>
--- NEW FILE: FredCK.FCKeditorV2.csproj.user ---
<VisualStudioProject>
<CSHARP LastOpenVersion = "7.10.3077" >
<Build>
<Settings ReferencePath = "" >
<Config
Name = "Debug"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
<Config
Name = "Release"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
</Settings>
</Build>
<OtherProjectSettings
CopyProjectDestinationFolder = ""
CopyProjectUncPath = ""
CopyProjectOption = "0"
ProjectView = "ProjectFiles"
ProjectTrust = "0"
/>
</CSHARP>
</VisualStudioProject>
--- NEW FILE: FredCK.FCKeditorV2.snk ---
--- NEW FILE: XmlUtil.cs ---
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2004 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* File Name: XmlUtil.cs
* Useful tools.
*
* Version: 2.0 Beta 2
* Modified: 2004-05-31 23:17:24
*
* File Authors:
* Frederico Caldeira Knabben (fr...@fc...)
*/
using System ;
using System.Globalization ;
using System.Xml ;
namespace FredCK.FCKeditorV2
{
internal sealed class XmlUtil
{
private XmlUtil()
{}
public static XmlNode AppendElement( XmlNode node, string newElementName )
{
return AppendElement( node, newElementName, null ) ;
}
public static XmlNode AppendElement( XmlNode node, string newElementName, string innerValue )
{
XmlNode oNode ;
if ( node is XmlDocument )
oNode = node.AppendChild( ((XmlDocument)node).CreateElement( newElementName ) ) ;
else
oNode = node.AppendChild( node.OwnerDocument.CreateElement( newElementName ) ) ;
if ( innerValue != null )
oNode.AppendChild( node.OwnerDocument.CreateTextNode( innerValue ) ) ;
return oNode ;
}
public static XmlAttribute CreateAttribute( XmlDocument xmlDocument, string name, string value )
{
XmlAttribute oAtt = xmlDocument.CreateAttribute( name ) ;
oAtt.Value = value ;
return oAtt ;
}
public static void SetAttribute( XmlNode node, string attributeName, string attributeValue )
{
if ( node.Attributes[ attributeName ] != null )
node.Attributes[ attributeName ].Value = attributeValue ;
else
node.Attributes.Append( CreateAttribute( node.OwnerDocument, attributeName, attributeValue ) ) ;
}
}
}
|