温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:MyWebPages51aspx汉化最终版
1/* 2
* FCKeditor - The text editor for internet 3
* Copyright (C) 2003-2005 Frederico Caldeira Knabben 4
* 5
* Licensed under the terms of the GNU Lesser General Public License: 6
* http://www.opensource.org/licenses/lgpl-license.php 7
* 8
* For further information visit: 9
* http://www.fckeditor.net/ 10
* 11
* "Support Open Source software. What about a donation today?" 12
* 13
* File Name: FCKeditorConfigurations.cs 14
* Class that holds all editor configurations. 15
* 16
* File Authors: 17
* Frederico Caldeira Knabben (fredck@fckeditor.net) 18
*/ 19
20
using System ; 21
using System.Collections ; 22
using System.Runtime.Serialization ; 23
24
namespace FredCK.FCKeditorV2 25
{ 26
[ Serializable() ] 27
public class FCKeditorConfigurations : ISerializable 28
{ 29
private Hashtable _Configs ; 30
31
internal FCKeditorConfigurations() 32
{ 33
_Configs = new Hashtable() ; 34
} 35
36
protected FCKeditorConfigurations( SerializationInfo info, StreamingContext context ) 37
{ 38
_Configs = (Hashtable)info.GetValue( "ConfigTable", typeof( Hashtable ) ) ; 39
} 40
41
public string this[ string configurationName ] 42
{ 43
get 44
{ 45
if ( _Configs.ContainsKey( configurationName ) ) 46
return (string)_Configs[ configurationName ] ; 47
else 48
return null ; 49
} 50
set 51
{ 52
_Configs[ configurationName ] = value ; 53
} 54
} 55
56
internal string GetHiddenFieldString() 57
{ 58
System.Text.StringBuilder osParams = new System.Text.StringBuilder() ; 59
60
foreach ( DictionaryEntry oEntry in _Configs ) 61
{ 62
if ( osParams.Length > 0 ) 63
osParams.Append( "&" ) ; 64
65
osParams.AppendFormat( "{0}={1}", EncodeConfig( oEntry.Key.ToString() ), EncodeConfig( oEntry.Value.ToString() ) ) ; 66
} 67
68
return osParams.ToString() ; 69
} 70
71
private string EncodeConfig( string valueToEncode ) 72
{ 73
string sEncoded = valueToEncode.Replace( "&", "%26" ) ; 74
sEncoded = sEncoded.Replace( "=", "%3D" ) ; 75
sEncoded = sEncoded.Replace( "\"", "%22" ) ; 76
77
return sEncoded ; 78
} 79
80
ISerializable Members 88
} 89
} 90



* FCKeditor - The text editor for internet

}