diff --git a/CassiniDev/BuildDeploy.cmd b/CassiniDev/BuildDeploy.cmd new file mode 100644 index 000000000..22683d94f --- /dev/null +++ b/CassiniDev/BuildDeploy.cmd @@ -0,0 +1,7 @@ +del ..\deploy\*.* /s/q +xcopy bin\x86 ..\deploy /S /I /F /Y ..\deploy.txt +copy ..\*.txt ..\deploy\ /Y diff --git a/CassiniDev/CassiniDev.4.csproj b/CassiniDev/CassiniDev.4.csproj new file mode 100644 index 000000000..972d2f802 --- /dev/null +++ b/CassiniDev/CassiniDev.4.csproj @@ -0,0 +1,180 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {9AAD02EE-FE79-46BE-87EB-E3D2A376A043} + WinExe + Properties + CassiniDev + CassiniDev4 + v4.0 + 512 + true + ..\CasssiniDev-DevKey.snk + Resources\preferences-web-browser-shortcuts.ico + + + 3.5 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + + + true + bin\x86\Debug\ + TRACE;DEBUG;NET40 + true + full + x86 + bin\Debug\CassiniDev4\CassiniDev4.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + + + bin\x86\Release\ + TRACE;NET40 + true + true + pdbonly + x86 + bin\Release\CassiniDev4\CassiniDev4.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + false + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + + + + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + Component + + + + + + UserControl + + + BodyView.cs + + + Form + + + FormView.cs + + + Form + + + LogView.cs + + + + + + BodyView.cs + + + FormView.cs + + + LogView.cs + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + Always + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Console.csproj b/CassiniDev/CassiniDev.Console.csproj new file mode 100644 index 000000000..49b6e70d6 --- /dev/null +++ b/CassiniDev/CassiniDev.Console.csproj @@ -0,0 +1,105 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {539F0304-F14A-413F-A56A-AFB7724EA1A7} + Exe + Properties + CassiniDev + CassiniDev-console + v3.5 + 512 + + + + + + + + + true + ..\CasssiniDev-DevKey.snk + Resources\preferences-web-browser-shortcuts.ico + + + true + bin\x86\Debug\ + TRACE;DEBUG + true + full + x86 + true + GlobalSuppressions.cs + prompt + + + bin\x86\Release\ + TRACE;CONSOLE + true + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + + + + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + Component + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Console4.csproj b/CassiniDev/CassiniDev.Console4.csproj new file mode 100644 index 000000000..0148be558 --- /dev/null +++ b/CassiniDev/CassiniDev.Console4.csproj @@ -0,0 +1,156 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {539F0304-F14A-413F-A56A-AFB7724EA1A7} + Exe + Properties + CassiniDev + CassiniDev4-console + v4.0 + 512 + + + + + + + + + true + ..\CasssiniDev-DevKey.snk + Resources\preferences-web-browser-shortcuts.ico + + + 3.5 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + bin\x86\Debug\ + TRACE;DEBUG;NET40 + true + full + x86 + bin\Debug\CassiniDev4.Console\CassiniDev4-console.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + bin\x86\Release\ + TRACE;NET40 + true + true + pdbonly + x86 + bin\Release\CassiniDev4.Console\CassiniDev4-console.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + Component + + + + + + + + + + + + + Always + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Lib.csproj b/CassiniDev/CassiniDev.Lib.csproj new file mode 100644 index 000000000..1d06077de --- /dev/null +++ b/CassiniDev/CassiniDev.Lib.csproj @@ -0,0 +1,96 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {9AAD02EE-FE79-46BE-87EB-E3D2A376A043} + Library + Properties + CassiniDev + CassiniDev-lib + v3.5 + 512 + true + ..\CasssiniDev-DevKey.snk + Resources\preferences-web-browser-shortcuts.ico + + + true + bin\x86\Debug\ + DEBUG;TRACE + true + full + x86 + true + GlobalSuppressions.cs + prompt + + + bin\x86\Release\ + TRACE + true + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + + + + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + Component + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.Lib4.csproj b/CassiniDev/CassiniDev.Lib4.csproj new file mode 100644 index 000000000..cebce2220 --- /dev/null +++ b/CassiniDev/CassiniDev.Lib4.csproj @@ -0,0 +1,148 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {070AE36D-4CE1-4708-BD0F-2896A6F117FC} + Library + Properties + CassiniDev + CassiniDev4-lib + v4.0 + 512 + false + ..\CasssiniDev-DevKey.snk + Resources\preferences-web-browser-shortcuts.ico + + + 3.5 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + bin\x86\Debug\ + TRACE;DEBUG;NET40 + true + full + x86 + bin\Debug\CassiniDev4.Lib\CassiniDev4-lib.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + bin\x86\Release\ + TRACE;NET40 + true + true + pdbonly + x86 + bin\Release\CassiniDev4.Lib\CassiniDev4-lib.dll.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + false + false + + + + + + + 3.5 + + + + + + + + + + + + + + + + + + Code + + + Code + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + Always + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.VisualStudio.csproj b/CassiniDev/CassiniDev.VisualStudio.csproj new file mode 100644 index 000000000..e3b6b11bd --- /dev/null +++ b/CassiniDev/CassiniDev.VisualStudio.csproj @@ -0,0 +1,177 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F50EB799-6DED-4906-9DB0-B8FBE5C14028} + WinExe + Properties + CassiniDev + WebDev.WebServer + v3.5 + 512 + Resources\preferences-web-browser-shortcuts.ico + true + ..\CasssiniDev-DevKey.snk + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + bin\x86\Debug\ + TRACE;DEBUG + true + full + x86 + true + GlobalSuppressions.cs + prompt + + + bin\x86\Release\ + TRACE;GUI + true + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + + + + + + + 3.5 + + + + + + + + + + + + + + + Component + + + Code + + + + + + + + + + + + + + + + + + + + UserControl + + + BodyView.cs + + + Form + + + FormView.cs + + + Form + + + LogView.cs + + + + + + BodyView.cs + + + FormView.cs + + + LogView.cs + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.VisualStudio42.csproj b/CassiniDev/CassiniDev.VisualStudio42.csproj new file mode 100644 index 000000000..d9e244ef3 --- /dev/null +++ b/CassiniDev/CassiniDev.VisualStudio42.csproj @@ -0,0 +1,181 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {06764838-9B08-4254-AFA6-2B790E110DFB} + WinExe + Properties + CassiniDev + WebDev.WebServer20 + v3.5 + 512 + Resources\preferences-web-browser-shortcuts.ico + true + ..\CasssiniDev-DevKey.snk + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + bin\x86\Debug\ + TRACE;DEBUG + true + full + x86 + true + GlobalSuppressions.cs + prompt + + + bin\x86\Release\ + TRACE;GUI + true + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + + + + + + + 3.5 + + + False + True + + + + + + False + + + + + + + + + + Component + + + Code + + + + + + + + + + + + + + + + + + + + UserControl + + + BodyView.cs + + + Form + + + FormView.cs + + + Form + + + LogView.cs + + + + + + BodyView.cs + + + FormView.cs + + + LogView.cs + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.VisualStudio44.csproj b/CassiniDev/CassiniDev.VisualStudio44.csproj new file mode 100644 index 000000000..07cdbb347 --- /dev/null +++ b/CassiniDev/CassiniDev.VisualStudio44.csproj @@ -0,0 +1,190 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {73C76E4C-426C-45C2-9D37-1E46FA29CE66} + WinExe + Properties + CassiniDev + WebDev.WebServer40 + v4.0 + 512 + Resources\preferences-web-browser-shortcuts.ico + true + ..\CasssiniDev-DevKey.snk + + + 3.5 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + bin\x86\Debug\ + TRACE;DEBUG;NET40 + true + full + x86 + bin\Debug\DevServer\10.0\WebDev.WebServer40.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + bin\x86\Release\ + TRACE;NET40 + true + true + pdbonly + x86 + bin\Release\DevServer\10.0\WebDev.WebServer40.exe.CodeAnalysisLog.xml + true + GlobalSuppressions.cs + prompt + AllRules.ruleset + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets + true + ;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules + true + + + + + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Component + + + + + + UserControl + + + BodyView.cs + + + Form + + + FormView.cs + + + Form + + + HelpView.cs + + + Form + + + LogView.cs + + + + + + BodyView.cs + + + FormView.cs + + + HelpView.cs + + + LogView.cs + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + Always + Designer + + + + + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev.csproj b/CassiniDev/CassiniDev.csproj new file mode 100644 index 000000000..e7050b015 --- /dev/null +++ b/CassiniDev/CassiniDev.csproj @@ -0,0 +1,200 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0D9F0FEA-45F7-4CE4-9868-6FB9BBE3DD4C} + WinExe + Properties + CassiniDev + CassiniDev + v3.5 + 512 + Resources\preferences-web-browser-shortcuts.ico + + + + + + + + + + + true + ..\CasssiniDev-DevKey.snk + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + bin\x86\Debug\ + TRACE;DEBUG + true + full + x86 + true + GlobalSuppressions.cs + prompt + + + bin\x86\Release\ + TRACE + true + true + pdbonly + x86 + true + GlobalSuppressions.cs + prompt + + + + + + + 3.5 + + + + + + + + + + + + Component + + + + + + + + + UserControl + + + BodyView.cs + + + + Form + + + LogView.cs + + + + + + + + + + Form + + + FormView.cs + + + + + + + + + + + + + + + + + + + + + + + BodyView.cs + + + LogView.cs + + + FormView.cs + + + Designer + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev4-console.exe.config b/CassiniDev/CassiniDev4-console.exe.config new file mode 100644 index 000000000..22ab261b3 --- /dev/null +++ b/CassiniDev/CassiniDev4-console.exe.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev4-lib.dll.config b/CassiniDev/CassiniDev4-lib.dll.config new file mode 100644 index 000000000..22ab261b3 --- /dev/null +++ b/CassiniDev/CassiniDev4-lib.dll.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev4.csproj b/CassiniDev/CassiniDev4.csproj new file mode 100644 index 000000000..d52911de2 --- /dev/null +++ b/CassiniDev/CassiniDev4.csproj @@ -0,0 +1,163 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0D9F0FEA-45F7-4CE4-9868-6FB9BBE3DD4C} + WinExe + Properties + CassiniDev + CassiniDev + v3.5 + 512 + Resources\earth_network.ico + + + + + + + + + + + true + ..\CasssiniDev-DevKey.snk + + + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + + + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + 3.5 + + + + False + ..\lib\System.Data.SQLite.dll + False + + + + + + + + Form + + + HelpView.cs + + + + + + + + + UserControl + + + BodyView.cs + + + + + + Form + + + LogView.cs + + + + + + + + + + + Form + + + FormView.cs + + + + + + + + + + + + + + + + + + + + + Always + + + Always + + + + + BodyView.cs + + + HelpView.cs + + + LogView.cs + + + FormView.cs + + + Designer + + + + + + xcopy "$(TargetDir)$(TargetName).*" "$(ProjectDir)..\deploy\$(ConfigurationName)\" /S /I /F /Y <nul: + + \ No newline at end of file diff --git a/CassiniDev/CassiniDev4.exe.config b/CassiniDev/CassiniDev4.exe.config new file mode 100644 index 000000000..22ab261b3 --- /dev/null +++ b/CassiniDev/CassiniDev4.exe.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/CassiniDev/CassiniDevServerOP.cs b/CassiniDev/CassiniDevServerOP.cs new file mode 100644 index 000000000..dda970556 --- /dev/null +++ b/CassiniDev/CassiniDevServerOP.cs @@ -0,0 +1,241 @@ +// /* ********************************************************************************** +// * +// * Copyright (c) Sky Sanders. All rights reserved. +// * +// * This source code is subject to terms and conditions of the Microsoft Public +// * License (Ms-PL). A copy of the license can be found in the license.htm file +// * included in this distribution. +// * +// * You must not remove this notice, or any other, from this software. +// * +// * **********************************************************************************/ +using System; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Threading; + +namespace CassiniDev +{ + + /// + /// Made a go at spinning the server up from this process but after dealing with + /// irratic behaviour regarding apartment state, platform concerns, unloaded app domains, + /// and all the other issues that you can find that people struggle with I just decided + /// to strictly format the console app's output and just spin up an external process. + /// Seems robust so far. + /// + public class CassiniDevServerOP + { + //private bool _disposed; + + private string _hostname; + private StreamWriter _input; + private IPAddress _ipAddress; + private Thread _outputThread; + private string _rootUrl; + private Process _serverProcess; + private const int TimeOut = 60000; + private const int WaitForPort = 5000; + + + /// + /// + public void Dispose() + { + { + if (_serverProcess != null) + { + StopServer(); + } + } + } + + + /// + /// The root URL of the running web application + /// + public string RootUrl + { + get { return _rootUrl; } + } + + /// + /// Combine the RootUrl of the running web application with the relative url specified. + /// + /// + /// + public string NormalizeUrl(string relativeUrl) + { + return CassiniNetworkUtils.NormalizeUrl(RootUrl, relativeUrl); + } + + /// + /// Will start specified application as "localhost" on loopback and first available port in the range 8000-10000 with vpath "/" + /// + /// Physical path to application. + public void StartServer(string applicationPath) + { + StartServer(applicationPath, CassiniNetworkUtils.GetAvailablePort(8000, 10000, IPAddress.Loopback, true), "/", "localhost"); + } + + /// + /// Will start specified application on loopback + /// + /// Physical path to application. + /// Port to listen on. + /// Optional. defaults to "/" + /// Optional. Is used to construct RootUrl. Defaults to "localhost" + public void StartServer(string applicationPath, int port, string virtualPath, string hostName) + { + // WebHost.Server will not run on any other IP + IPAddress ipAddress = IPAddress.Loopback; + + if (!CassiniNetworkUtils.IsPortAvailable(ipAddress, port)) + { + throw new Exception(string.Format("Port {0} is in use.", port)); + } + + applicationPath = Path.GetFullPath(applicationPath); + + virtualPath = String.Format("/{0}/", (virtualPath ?? string.Empty).Trim('/')).Replace("//", "/"); + hostName = string.IsNullOrEmpty(hostName) ? "localhost" : hostName; + + StartServer(applicationPath, ipAddress, port, virtualPath, hostName); + + + } + /// + /// + /// Physical path to application. + /// IP to listen on. + /// Port to listen on. + /// Optional. default value '/' + /// Optional. Used to construct RootUrl. Defaults to 'localhost' + public virtual void StartServer(string applicationPath, IPAddress ipAddress, int port, string virtualPath, string hostName) + { + + _hostname = hostName; + _ipAddress = ipAddress; + + // massage and validate arguments + if (string.IsNullOrEmpty(virtualPath)) + { + virtualPath = "/"; + } + if (!virtualPath.StartsWith("/")) + { + virtualPath = "/" + virtualPath; + } + if (_serverProcess != null) + { + throw new InvalidOperationException("Server is running"); + } + + + string commandLine = (new CommandLineArguments + { + Port = port, + ApplicationPath = string.Format("\"{0}\"", Path.GetFullPath(applicationPath).Trim('\"').TrimEnd('\\')), + HostName = hostName, + IPAddress = ipAddress.ToString(), + VirtualPath = string.Format("\"{0}\"", virtualPath), + TimeOut = TimeOut, + WaitForPort = WaitForPort, + IPMode = IPMode.Specific, + PortMode = PortMode.Specific + }).ToString(); + + + _serverProcess = new Process + { + StartInfo = new ProcessStartInfo + { + UseShellExecute = false, + ErrorDialog = false, + CreateNoWindow = true, + RedirectStandardOutput = true, + RedirectStandardInput = true, +#if NET40 //TODO: find out the real flag + FileName = "CassiniDev4-console.exe", +#else + FileName = "CassiniDev-console.exe", +#endif + + Arguments = commandLine, + WorkingDirectory = Environment.CurrentDirectory + } + }; + + // we are going to monitor each line of the output until we get a start or error signal + // and then just ignore the rest + + string line = null; + + _serverProcess.Start(); + + _outputThread = new Thread(() => + { + string l = _serverProcess.StandardOutput.ReadLine(); + while (l != null) + { + if (l.StartsWith("started:") || l.StartsWith("error:")) + { + line = l; + } + l = _serverProcess.StandardOutput.ReadLine(); + } + }); + _outputThread.Start(); + + // use StandardInput to send the newline to stop the server when required + _input = _serverProcess.StandardInput; + + // block until we get a signal + while (line == null) + { + Thread.Sleep(10); + } + + if (!line.StartsWith("started:")) + { + throw new Exception(string.Format("Could not start server: {0}", line)); + } + + // line is the root url + _rootUrl = line.Substring(line.IndexOf(':') + 1); + } + /// + /// Stops the server, if running. + /// + public virtual void StopServer() + { + StopServer(100); + } + + /// + /// Stops the server, if running. + /// + protected virtual void StopServer(int delay) + { + Thread.Sleep(delay); + if (_serverProcess != null) + { + try + { + _input.WriteLine(); + _serverProcess.WaitForExit(10000); + Thread.Sleep(10); + } + catch + { + } + finally + { + _serverProcess.Dispose(); + _serverProcess = null; + } + } + } + } +} diff --git a/CassiniDev/CassiniServer.cs b/CassiniDev/CassiniServer.cs new file mode 100644 index 000000000..956298627 --- /dev/null +++ b/CassiniDev/CassiniServer.cs @@ -0,0 +1,140 @@ +// /* ********************************************************************************** +// * +// * Copyright (c) Sky Sanders. All rights reserved. +// * +// * This source code is subject to terms and conditions of the Microsoft Public +// * License (Ms-PL). A copy of the license can be found in the license.htm file +// * included in this distribution. +// * +// * You must not remove this notice, or any other, from this software. +// * +// * **********************************************************************************/ +using System; +using System.Globalization; +using System.IO; +using System.Net; + + +namespace CassiniDev +{ + public class CassiniDevServer + { + + private Server _server; + + #region Implementation of IDisposable + + /// + /// + public void Dispose() + { + if (_server != null) + { + StopServer(); + _server.Dispose(); + _server = null; + } + } + + #endregion + + + + + + /// + /// The root URL of the running web application + /// + public string RootUrl + { + get { return string.Format(CultureInfo.InvariantCulture, "http://{0}:{1}{2}", _server.HostName, _server.Port, _server.VirtualPath); } + + } + /// + /// Combine the RootUrl of the running web application with the relative url + /// specified. + /// + /// + /// + public string NormalizeUrl(string relativeUrl) + { + return CassiniNetworkUtils.NormalizeUrl(RootUrl, relativeUrl); + } + + /// + /// Will start specified application as "localhost" on loopback and first available port in the range 8000-10000 with vpath "/" + /// + /// Physical path to application. + public void StartServer(string applicationPath) + { + StartServer(applicationPath, CassiniNetworkUtils.GetAvailablePort(8000, 10000, IPAddress.Loopback, true), "/", "localhost"); + } + + /// + /// Will start specified application on loopback + /// + /// Physical path to application. + /// Port to listen on. + /// Optional. defaults to "/" + /// Optional. Is used to construct RootUrl. Defaults to "localhost" + public void StartServer(string applicationPath, int port, string virtualPath, string hostName) + { + // WebHost.Server will not run on any other IP + IPAddress ipAddress = IPAddress.Loopback; + + if (!CassiniNetworkUtils.IsPortAvailable(ipAddress, port)) + { + throw new Exception(string.Format("Port {0} is in use.", port)); + } + + applicationPath = Path.GetFullPath(applicationPath); + + virtualPath = String.Format("/{0}/", (virtualPath ?? string.Empty).Trim('/')).Replace("//", "/"); + hostName = string.IsNullOrEmpty(hostName) ? "localhost" : hostName; + + StartServer(applicationPath, ipAddress, port, virtualPath, hostName); + + + } + + /// + /// + /// Physical path to application. + /// IP to listen on. + /// Port to listen on. + /// Optional. default value '/' + /// Optional. Used to construct RootUrl. Defaults to 'localhost' + public void StartServer(string applicationPath, IPAddress ipAddress, int port, string virtualPath, string hostname) + { + if (_server != null) + { + throw new InvalidOperationException("Server already started"); + } + _server = new Server(port, virtualPath, applicationPath, ipAddress,hostname, 60000); + + try + { + _server.Start(); + } + catch (Exception ex) + { + + throw new InvalidOperationException("Error starting server instance.", ex); + } + + } + + /// + /// Stops the server. + /// + public void StopServer() + { + if (_server != null) + { + _server.ShutDown(); + } + } + + + } +} diff --git a/CassiniDev/Configuration/CassiniDevConfigurationSection.cs b/CassiniDev/Configuration/CassiniDevConfigurationSection.cs new file mode 100644 index 000000000..78bfd8055 --- /dev/null +++ b/CassiniDev/Configuration/CassiniDevConfigurationSection.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Net; +using System.Text; + +namespace CassiniDev.Configuration +{ + public class CassiniDevConfigurationSection : ConfigurationSection + { + [ConfigurationProperty("profiles")] + public CassiniDevProfileElementCollection Profiles + { + get + { + return (CassiniDevProfileElementCollection)this["profiles"]; + } + } + } + + [ConfigurationCollection(typeof(CassiniDevProfileElement), AddItemName = "profile", CollectionType = ConfigurationElementCollectionType.BasicMap)] + public class CassiniDevProfileElementCollection : ConfigurationElementCollection + { + protected override ConfigurationElement CreateNewElement() + { + return new CassiniDevProfileElement(); + } + + protected override object GetElementKey(ConfigurationElement element) + { + return ((CassiniDevProfileElement)element).Port; + } + } + public class CassiniDevProfileElement : ConfigurationElement + { + /// + /// Port is used as profile selector + /// + [ConfigurationProperty("port", DefaultValue = "*", IsKey = true, IsRequired = true)] + public string Port + { + get + { + return (string)this["port"]; + } + set + { + this["port"] = value; + } + } + + [ConfigurationProperty("path")] + public string Path + { + get + { + return (string)this["path"]; + } + set + { + this["path"] = value; + } + } + + + + + [ConfigurationProperty("hostName")] + public string HostName + { + get + { + return (string)this["hostName"]; + } + set + { + this["hostName"] = value; + } + } + + [ConfigurationProperty("ip")] + public string IpAddress + { + get + { + return (string)this["ip"]; + } + set + { + this["ip"] = value; + } + } + + [ConfigurationProperty("ipMode", DefaultValue = CassiniDev.IPMode.Loopback)] + public IPMode IpMode + { + get + { + return (IPMode)this["ipMode"]; + } + set + { + this["ipMode"] = value; + } + } + + [ConfigurationProperty("v6", DefaultValue = false)] + public bool IpV6 + { + get + { + return (bool)this["v6"]; + } + set + { + this["v6"] = value; + } + } + } +} diff --git a/CassiniDev/ConsoleProgram.cs b/CassiniDev/ConsoleProgram.cs new file mode 100644 index 000000000..94e6a3adb --- /dev/null +++ b/CassiniDev/ConsoleProgram.cs @@ -0,0 +1,156 @@ +// /* ********************************************************************************** +// * +// * Copyright (c) Sky Sanders. All rights reserved. +// * +// * This source code is subject to terms and conditions of the Microsoft Public +// * License (Ms-PL). A copy of the license can be found in the license.htm file +// * included in this distribution. +// * +// * You must not remove this notice, or any other, from this software. +// * +// * **********************************************************************************/ +using System; +using System.Collections; +using System.Configuration.Install; +using System.Net; + + + + +namespace CassiniDev +{ + public class Program + { + [STAThread] + private static void Main(string[] cmdLine) + { + CommandLineArguments args = new CommandLineArguments(); + + + if (!CommandLineParser.ParseArgumentsWithUsage(cmdLine, args)) + { + Environment.Exit(-1); + } + else + { + switch (args.RunMode) + { + case RunMode.Server: + IPAddress ip=IPAddress.Loopback; + try + { + args.Validate(); + + ip = CommandLineArguments.ParseIP(args.IPMode, args.IPv6, args.IPAddress); + int port = args.PortMode == PortMode.FirstAvailable ? + CassiniNetworkUtils.GetAvailablePort(args.PortRangeStart, args.PortRangeEnd, ip, true) : + args.Port; + + if(args.AddHost) + { + HostsFile.AddHostEntry(ip.ToString(), args.HostName); + } + + using (var server = + new Server(port, args.VirtualPath, args.ApplicationPath, + ip, args.HostName, args.TimeOut)) + { + server.Start(); + Console.WriteLine("started: {0}\r\nPress Enter key to exit....", server.RootUrl); + Console.ReadLine(); + server.ShutDown(); + } + } + catch (CassiniException ex) + { + Console.WriteLine("error:{0} {1}", + ex.Field == ErrorField.None + ? ex.GetType().Name + : ex.Field.ToString(), ex.Message); + } + catch (Exception ex2) + { + Console.WriteLine("error:{0}", ex2.Message); + Console.WriteLine(CommandLineParser.ArgumentsUsage(typeof(CommandLineArguments))); + } + finally + { + if (args.AddHost) + { + HostsFile.RemoveHostEntry(ip.ToString(), args.HostName); + } + + } + break; + case RunMode.Hostsfile: + SetHostsFile(args); + break; + } + } + } + + private static void SetHostsFile(CommandLineArguments sargs) + { + try + { + if (sargs.AddHost) + { + HostsFile.AddHostEntry(sargs.IPAddress, sargs.HostName); + } + else + { + HostsFile.RemoveHostEntry(sargs.IPAddress, sargs.HostName); + } + } + catch (UnauthorizedAccessException) + { + Environment.Exit(-1); + } + catch + { + Environment.Exit(-2); + } + } + } + + public sealed class ServiceUtil + { + static void Install(bool undo, string[] args) + { + try + { + Console.WriteLine(undo ? "uninstalling" : "installing"); + using (AssemblyInstaller inst = new AssemblyInstaller(typeof(Program).Assembly, args)) + { + IDictionary state = new Hashtable(); + inst.UseNewContext = true; + try + { + if (undo) + { + inst.Uninstall(state); + } + else + { + inst.Install(state); + inst.Commit(state); + } + } + catch + { + try + { + inst.Rollback(state); + } + catch { } + throw; + } + } + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.Message); + } + } + } +} \ No newline at end of file diff --git a/CassiniDev/Core/Connection.cs b/CassiniDev/Core/Connection.cs new file mode 100644 index 000000000..c04731fd0 --- /dev/null +++ b/CassiniDev/Core/Connection.cs @@ -0,0 +1,410 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Web; +using CassiniDev.ServerLog; + +#endregion + +namespace CassiniDev +{ + public class Connection : MarshalByRefObject + { + private const int HttpForbidden = 403; + + private const int HttpOK = 200; + + private readonly MemoryStream _responseContent; + + private readonly Server _server; + private LogInfo _requestLog; + private LogInfo _responseLog; + + private Socket _socket; + + internal Connection(Server server, Socket socket) + { + Id = Guid.NewGuid(); + _responseContent = new MemoryStream(); + _server = server; + _socket = socket; + InitializeLogInfo(); + } + + public bool Connected + { + get { return _socket.Connected; } + } + + public Guid Id { get; private set; } + + public string LocalIP + { + get + { + IPEndPoint ep = (IPEndPoint) _socket.LocalEndPoint; + return (ep != null && ep.Address != null) ? ep.Address.ToString() : "127.0.0.1"; + } + } + + public string RemoteIP + { + get + { + IPEndPoint ep = (IPEndPoint) _socket.RemoteEndPoint; + return (ep != null && ep.Address != null) ? ep.Address.ToString() : "127.0.0.1"; + } + } + + public LogInfo RequestLog + { + get { return _requestLog; } + } + + public LogInfo ResponseLog + { + get { return _responseLog; } + } + + public void Close() + { + FinalizeLogInfo(); + + try + { + _socket.Shutdown(SocketShutdown.Both); + _socket.Close(); + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + finally + { + _socket = null; + } + } + + /// + /// + public override object InitializeLifetimeService() + { + return null; + } + + public void LogRequest(string pathTranslated, string url) + { + _requestLog.PathTranslated = pathTranslated; + + _requestLog.Url = url; + } + + public void LogRequestBody(byte[] content) + { + _requestLog.Body = content; + } + + public void LogRequestHeaders(string headers) + { + _requestLog.Headers = headers; + } + + public byte[] ReadRequestBytes(int maxBytes) + { + try + { + if (WaitForRequestBytes() == 0) + { + return null; + } + + int numBytes = _socket.Available; + + if (numBytes > maxBytes) + { + numBytes = maxBytes; + } + + int numReceived = 0; + + byte[] buffer = new byte[numBytes]; + + if (numBytes > 0) + { + numReceived = _socket.Receive(buffer, 0, numBytes, SocketFlags.None); + } + + if (numReceived < numBytes) + { + byte[] tempBuffer = new byte[numReceived]; + + if (numReceived > 0) + { + Buffer.BlockCopy(buffer, 0, tempBuffer, 0, numReceived); + } + + buffer = tempBuffer; + } + + return buffer; + } + catch + { + return null; + } + } + + public int WaitForRequestBytes() + { + int availBytes = 0; + + try + { + if (_socket.Available == 0) + { + _socket.Poll(100000, SelectMode.SelectRead); + + if (_socket.Available == 0 && _socket.Connected) + { + _socket.Poll(30000000, SelectMode.SelectRead); + } + } + + availBytes = _socket.Available; + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + + return availBytes; + } + + public void Write100Continue() + { + WriteEntireResponseFromString(100, null, null, true); + } + + public void WriteBody(byte[] data, int offset, int length) + { + try + { + _responseContent.Write(data, 0, data.Length); + _socket.Send(data, offset, length, SocketFlags.None); + } + catch (SocketException) + { + } + } + + public void WriteEntireResponseFromFile(String fileName, bool keepAlive) + { + if (!File.Exists(fileName)) + { + WriteErrorAndClose(404); + return; + } + + // Deny the request if the contentType cannot be recognized. + + string contentType = Common.GetContentType(fileName); + + //TODO: i am pretty sure this is unnecessary + if (contentType == null) + { + WriteErrorAndClose(HttpForbidden); + return; + } + + string contentTypeHeader = "Content-Type: " + contentType + "\r\n"; + + bool completed = false; + FileStream fs = null; + + try + { + fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + int len = (int) fs.Length; + byte[] fileBytes = new byte[len]; + int bytesRead = fs.Read(fileBytes, 0, len); + + String headers = MakeResponseHeaders(HttpOK, contentTypeHeader, bytesRead, keepAlive); + _responseLog.Headers = headers; + _responseLog.StatusCode = HttpOK; + _socket.Send(Encoding.UTF8.GetBytes(headers)); + + _socket.Send(fileBytes, 0, bytesRead, SocketFlags.None); + + completed = true; + } + catch (SocketException) + { + } + finally + { + if (!keepAlive || !completed) + { + Close(); + } + + if (fs != null) + { + fs.Close(); + } + } + } + + public void WriteEntireResponseFromString(int statusCode, String extraHeaders, String body, bool keepAlive) + { + try + { + int bodyLength = (body != null) ? Encoding.UTF8.GetByteCount(body) : 0; + string headers = MakeResponseHeaders(statusCode, extraHeaders, bodyLength, keepAlive); + + _responseLog.Headers = headers; + _responseLog.StatusCode = statusCode; + _socket.Send(Encoding.UTF8.GetBytes(headers + body)); + } + catch (SocketException) + { + } + finally + { + if (!keepAlive) + { + Close(); + } + } + } + + public void WriteErrorAndClose(int statusCode, string message) + { + WriteEntireResponseFromString(statusCode, null, GetErrorResponseBody(statusCode, message), false); + } + + public void WriteErrorAndClose(int statusCode) + { + WriteErrorAndClose(statusCode, null); + } + + public void WriteErrorWithExtraHeadersAndKeepAlive(int statusCode, string extraHeaders) + { + WriteEntireResponseFromString(statusCode, extraHeaders, GetErrorResponseBody(statusCode, null), true); + } + + public void WriteHeaders(int statusCode, String extraHeaders) + { + string headers = MakeResponseHeaders(statusCode, extraHeaders, -1, false); + + _responseLog.Headers = headers; + _responseLog.StatusCode = statusCode; + + try + { + _socket.Send(Encoding.UTF8.GetBytes(headers)); + } + catch (SocketException) + { + } + } + + private void FinalizeLogInfo() + { + try + { + _responseLog.Body = _responseContent.ToArray(); + _responseContent.Dispose(); + _responseLog.Created = DateTime.Now; + _responseLog.Url = _requestLog.Url; + _responseLog.PathTranslated = _requestLog.PathTranslated; + _responseLog.Identity = _requestLog.Identity; + _responseLog.PhysicalPath = _requestLog.PhysicalPath; + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + // log error to text + } + } + + private string GetErrorResponseBody(int statusCode, string message) + { + string body = Messages.FormatErrorMessageBody(statusCode, _server.VirtualPath); + + if (!string.IsNullOrEmpty(message)) + { + body += "\r\n"; + } + + return body; + } + + private void InitializeLogInfo() + { + _requestLog = new LogInfo + { + Created = DateTime.Now, + ConversationId = Id, + RowType = 1, + Identity = _server.GetProcessUser(), + PhysicalPath = _server.PhysicalPath + }; + + _responseLog = new LogInfo + { + ConversationId = Id, + RowType = 2 + }; + } + + private static string MakeResponseHeaders(int statusCode, string moreHeaders, int contentLength, bool keepAlive) + { + StringBuilder sb = new StringBuilder(); + + sb.Append("HTTP/1.1 " + statusCode + " " + HttpWorkerRequest.GetStatusDescription(statusCode) + "\r\n"); + sb.Append("Server: Cassini/" + Messages.VersionString + "\r\n"); + sb.Append("Date: " + DateTime.Now.ToUniversalTime().ToString("R", DateTimeFormatInfo.InvariantInfo) + "\r\n"); + + if (contentLength >= 0) + { + sb.Append("Content-Length: " + contentLength + "\r\n"); + } + + if (moreHeaders != null) + { + sb.Append(moreHeaders); + } + + if (!keepAlive) + { + sb.Append("Connection: Close\r\n"); + } + + sb.Append("\r\n"); + + return sb.ToString(); + } + } +} \ No newline at end of file diff --git a/CassiniDev/Core/Host.cs b/CassiniDev/Core/Host.cs new file mode 100644 index 000000000..46569f6e0 --- /dev/null +++ b/CassiniDev/Core/Host.cs @@ -0,0 +1,296 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Globalization; +using System.Security.Permissions; +using System.Security.Principal; +using System.Threading; +using System.Web; +using System.Web.Hosting; + +#endregion + +namespace CassiniDev +{ + /// + /// 01/01/10 sky: added HttpRuntime.Close to IRegisteredObject.Stop to eliminate + /// System.AppDomainUnloadedException when running tests in NUnit GuiRunner. + /// reference: http://stackoverflow.com/questions/561402/cassini-webserver-webdev-nunit-and-appdomainunloadedexception + /// need to test thoroughly but seems to work just fine with no ill effects + /// 01.03.10 sky: removed the HttpRuntime.Close because, even though it tests fine, I am not entirely certain it is in the right place + /// and since I am no longer recommending that the server be used as a library in testing (run a console instance in a new process). + /// + /// + internal class Host : MarshalByRefObject, IRegisteredObject + { + private bool _disableDirectoryListing; + + private string _installPath; + + private string _lowerCasedClientScriptPathWithTrailingSlash; + + private string _lowerCasedVirtualPath; + + private string _lowerCasedVirtualPathWithTrailingSlash; + + private volatile int _pendingCallsCount; + + private string _physicalClientScriptPath; + + private string _physicalPath; + + private int _port; + + private bool _requireAuthentication; + + private Server _server; + + private string _virtualPath; + + public Host() + { + HostingEnvironment.RegisterObject(this); + } + + public bool DisableDirectoryListing + { + get { return _disableDirectoryListing; } + } + + public string InstallPath + { + get { return _installPath; } + } + + public string NormalizedClientScriptPath + { + get { return _lowerCasedClientScriptPathWithTrailingSlash; } + } + + public string NormalizedVirtualPath + { + get { return _lowerCasedVirtualPathWithTrailingSlash; } + } + + public string PhysicalClientScriptPath + { + get { return _physicalClientScriptPath; } + } + + public string PhysicalPath + { + get { return _physicalPath; } + } + + public int Port + { + get { return _port; } + } + + public bool RequireAuthentication + { + get { return _requireAuthentication; } + } + + public string VirtualPath + { + get { return _virtualPath; } + } + + #region IRegisteredObject Members + + void IRegisteredObject.Stop(bool immediate) + { + // Unhook the Host so Server will process the requests in the new appdomain. + + if (_server != null) + { + _server.HostStopped(); + } + + // Make sure all the pending calls complete before this Object is unregistered. + WaitForPendingCallsToFinish(); + + HostingEnvironment.UnregisterObject(this); + } + + #endregion + + public void Configure(Server server, int port, string virtualPath, string physicalPath, + bool requireAuthentication) + { + Configure(server, port, virtualPath, physicalPath, requireAuthentication, false); + } + + public void Configure(Server server, int port, string virtualPath, string physicalPath) + { + Configure(server, port, virtualPath, physicalPath, false, false); + } + + public void Configure(Server server, int port, string virtualPath, string physicalPath, + bool requireAuthentication, bool disableDirectoryListing) + { + _server = server; + + _port = port; + _installPath = null; + _virtualPath = virtualPath; + _requireAuthentication = requireAuthentication; + _disableDirectoryListing = disableDirectoryListing; + _lowerCasedVirtualPath = CultureInfo.InvariantCulture.TextInfo.ToLower(_virtualPath); + _lowerCasedVirtualPathWithTrailingSlash = virtualPath.EndsWith("/", StringComparison.Ordinal) + ? virtualPath + : virtualPath + "/"; + _lowerCasedVirtualPathWithTrailingSlash = + CultureInfo.InvariantCulture.TextInfo.ToLower(_lowerCasedVirtualPathWithTrailingSlash); + _physicalPath = physicalPath; + _physicalClientScriptPath = HttpRuntime.AspClientScriptPhysicalPath + "\\"; + _lowerCasedClientScriptPathWithTrailingSlash = + CultureInfo.InvariantCulture.TextInfo.ToLower(HttpRuntime.AspClientScriptVirtualPath + "/"); + } + + public SecurityIdentifier GetProcessSid() + { + using (WindowsIdentity identity = new WindowsIdentity(_server.GetProcessToken())) + { + return identity.User; + } + } + + public IntPtr GetProcessToken() + { + new SecurityPermission(PermissionState.Unrestricted).Assert(); + return _server.GetProcessToken(); + } + + public string GetProcessUser() + { + return _server.GetProcessUser(); + } + + public override object InitializeLifetimeService() + { + // never expire the license + return null; + } + + public bool IsVirtualPathAppPath(string path) + { + if (path == null) + { + return false; + } + path = CultureInfo.InvariantCulture.TextInfo.ToLower(path); + return (path == _lowerCasedVirtualPath || path == _lowerCasedVirtualPathWithTrailingSlash); + } + + public bool IsVirtualPathInApp(string path, out bool isClientScriptPath) + { + isClientScriptPath = false; + + if (path == null) + { + return false; + } + + if (_virtualPath == "/" && path.StartsWith("/", StringComparison.Ordinal)) + { + if (path.StartsWith(_lowerCasedClientScriptPathWithTrailingSlash, StringComparison.Ordinal)) + { + isClientScriptPath = true; + } + return true; + } + + path = CultureInfo.InvariantCulture.TextInfo.ToLower(path); + + if (path.StartsWith(_lowerCasedVirtualPathWithTrailingSlash, StringComparison.Ordinal)) + { + return true; + } + + if (path == _lowerCasedVirtualPath) + { + return true; + } + + if (path.StartsWith(_lowerCasedClientScriptPathWithTrailingSlash, StringComparison.Ordinal)) + { + isClientScriptPath = true; + return true; + } + + return false; + } + + public bool IsVirtualPathInApp(String path) + { + bool isClientScriptPath; + return IsVirtualPathInApp(path, out isClientScriptPath); + } + + public void ProcessRequest(Connection conn) + { + // Add a pending call to make sure our thread doesn't get killed + AddPendingCall(); + + try + { + new Request(_server, this, conn).Process(); + } + finally + { + RemovePendingCall(); + } + } + + [SecurityPermission(SecurityAction.Assert, Unrestricted = true)] + public void Shutdown() + { + HostingEnvironment.InitiateShutdown(); + } + + private void AddPendingCall() + { + //TODO: investigate this issue - ref var not volitile +#pragma warning disable 0420 + Interlocked.Increment(ref _pendingCallsCount); +#pragma warning restore 0420 + } + + private void RemovePendingCall() + { + //TODO: investigate this issue - ref var not volitile +#pragma warning disable 0420 + Interlocked.Decrement(ref _pendingCallsCount); +#pragma warning restore 0420 + } + + private void WaitForPendingCallsToFinish() + { + for (;;) + { + if (_pendingCallsCount <= 0) + { + break; + } + + Thread.Sleep(250); + } + } + } +} \ No newline at end of file diff --git a/CassiniDev/Core/Messages.cs b/CassiniDev/Core/Messages.cs new file mode 100644 index 000000000..42b15887c --- /dev/null +++ b/CassiniDev/Core/Messages.cs @@ -0,0 +1,164 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System.IO; +using System.Text; +using System.Web; + +#endregion + +namespace CassiniDev +{ + /// + /// TODO: get this into resources + /// + internal static class Messages + { + private const string _dirListingDirFormat = + @"{0,38:dddd, MMMM dd, yyyy hh:mm tt} <dir> {2} +"; + + private const string _dirListingFileFormat = + @"{0,38:dddd, MMMM dd, yyyy hh:mm tt} {1,12:n0} {3} +"; + + private const string _dirListingFormat1 = + @" + + Directory Listing -- {0} +"; + + private const string _dirListingFormat2 = + @" + + +

Directory Listing -- {0}

+ +
+ +
+";
+
+        private const string _dirListingParentFormat =
+            @"[To Parent Directory]
+
+";
+
+        private const string _httpErrorFormat1 =
+            @"
+    
+        {0}
+";
+
+        private const string _httpStyle =
+            @"        
+";
+
+        private static readonly string _dirListingTail =
+            @"
+
+ + Version Information: Cassini Web Server " + + VersionString + @" + + + + + +"; + + private static readonly string _httpErrorFormat2 = + @" + + +

Server Error in '{0}' Application.

+ +

HTTP Error {1} - {2}.

+ +
+ + Version Information: Cassini Web Server " + + VersionString + @" + + + + + +"; + + public static string VersionString = typeof (Server).Assembly.GetName().Version.ToString(); + + public static string FormatDirectoryListing(string dirPath, string parentPath, FileSystemInfo[] elements) + { + StringBuilder sb = new StringBuilder(); + + sb.Append(string.Format(_dirListingFormat1, dirPath)); + sb.Append(_httpStyle); + sb.Append(string.Format(_dirListingFormat2, dirPath)); + + if (parentPath != null) + { + if (!parentPath.EndsWith("/")) + { + parentPath += "/"; + } + + sb.Append(string.Format(_dirListingParentFormat, parentPath)); + } + + if (elements != null) + { + for (int i = 0; i < elements.Length; i++) + { + if (elements[i] is FileInfo) + { + FileInfo fi = (FileInfo) elements[i]; + sb.Append(string.Format(_dirListingFileFormat, + fi.LastWriteTime, fi.Length, fi.Name, fi.Name)); + } + else if (elements[i] is DirectoryInfo) + { + DirectoryInfo di = (DirectoryInfo) elements[i]; + sb.Append(string.Format(_dirListingDirFormat, + di.LastWriteTime, di.Name, di.Name)); + } + } + } + + sb.Append(_dirListingTail); + return sb.ToString(); + } + + public static string FormatErrorMessageBody(int statusCode, string appName) + { + string desc = HttpWorkerRequest.GetStatusDescription(statusCode); + + return string.Format(_httpErrorFormat1, desc) + + _httpStyle + + string.Format(_httpErrorFormat2, appName, statusCode, desc); + } + } +} \ No newline at end of file diff --git a/CassiniDev/Core/NtlmAuth.cs b/CassiniDev/Core/NtlmAuth.cs new file mode 100644 index 000000000..40ab7df51 --- /dev/null +++ b/CassiniDev/Core/NtlmAuth.cs @@ -0,0 +1,179 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Security; +using System.Security.Principal; + +#endregion + +namespace CassiniDev +{ + [SuppressUnmanagedCodeSecurity] + internal sealed class NtlmAuth : IDisposable + { + private readonly bool _credentialsHandleAcquired; + + private string _blob; + + private bool _completed; + + private Interop.SecHandle _credentialsHandle; + + private Interop.SecBuffer _inputBuffer; + private Interop.SecBufferDesc _inputBufferDesc; + + private Interop.SecBuffer _outputBuffer; + + private Interop.SecBufferDesc _outputBufferDesc; + + private Interop.SecHandle _securityContext; + + private bool _securityContextAcquired; + + private uint _securityContextAttributes; + + private SecurityIdentifier _sid; + + private long _timestamp; + + public NtlmAuth() + { + if ( + Interop.AcquireCredentialsHandle(null, "NTLM", 1, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, + ref _credentialsHandle, ref _timestamp) != 0) + { + throw new InvalidOperationException(); + } + _credentialsHandleAcquired = true; + } + + public string Blob + { + get { return _blob; } + } + + public bool Completed + { + get { return _completed; } + } + + public SecurityIdentifier SID + { + get { return _sid; } + } + + #region IDisposable Members + + void IDisposable.Dispose() + { + FreeUnmanagedResources(); + GC.SuppressFinalize(this); + } + + #endregion + + public unsafe bool Authenticate(string blobString) + { + _blob = null; + byte[] buffer = Convert.FromBase64String(blobString); + byte[] inArray = new byte[0x4000]; + fixed (void* ptrRef = &_securityContext) + { + fixed (void* ptrRef2 = &_inputBuffer) + { + fixed (void* ptrRef3 = &_outputBuffer) + { + fixed (void* ptrRef4 = buffer) + { + fixed (void* ptrRef5 = inArray) + { + IntPtr zero = IntPtr.Zero; + if (_securityContextAcquired) + { + zero = (IntPtr) ptrRef; + } + _inputBufferDesc.ulVersion = 0; + _inputBufferDesc.cBuffers = 1; + _inputBufferDesc.pBuffers = (IntPtr) ptrRef2; + _inputBuffer.cbBuffer = (uint) buffer.Length; + _inputBuffer.BufferType = 2; + _inputBuffer.pvBuffer = (IntPtr) ptrRef4; + _outputBufferDesc.ulVersion = 0; + _outputBufferDesc.cBuffers = 1; + _outputBufferDesc.pBuffers = (IntPtr) ptrRef3; + _outputBuffer.cbBuffer = (uint) inArray.Length; + _outputBuffer.BufferType = 2; + _outputBuffer.pvBuffer = (IntPtr) ptrRef5; + int num = Interop.AcceptSecurityContext(ref _credentialsHandle, zero, + ref _inputBufferDesc, 20, + 0, ref _securityContext, ref _outputBufferDesc, + ref _securityContextAttributes, ref _timestamp); + if (num == 0x90312) + { + _securityContextAcquired = true; + _blob = Convert.ToBase64String(inArray, 0, (int) _outputBuffer.cbBuffer); + } + else + { + if (num != 0) + { + return false; + } + IntPtr phToken = IntPtr.Zero; + if (Interop.QuerySecurityContextToken(ref _securityContext, ref phToken) != 0) + { + return false; + } + try + { + using (WindowsIdentity identity = new WindowsIdentity(phToken)) + { + _sid = identity.User; + } + } + finally + { + Interop.CloseHandle(phToken); + } + _completed = true; + } + } + } + } + } + } + return true; + } + + ~NtlmAuth() + { + FreeUnmanagedResources(); + } + + private void FreeUnmanagedResources() + { + if (_securityContextAcquired) + { + Interop.DeleteSecurityContext(ref _securityContext); + } + if (_credentialsHandleAcquired) + { + Interop.FreeCredentialsHandle(ref _credentialsHandle); + } + } + } +} \ No newline at end of file diff --git a/CassiniDev/Core/Request.cs b/CassiniDev/Core/Request.cs new file mode 100644 index 000000000..50f5c06d7 --- /dev/null +++ b/CassiniDev/Core/Request.cs @@ -0,0 +1,1405 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Security; +using System.Security.Permissions; +using System.Text; +using System.Web; +using System.Web.Hosting; +using Microsoft.Win32.SafeHandles; + +#endregion + +namespace CassiniDev +{ + internal class Request : SimpleWorkerRequest + { + private const int MaxChunkLength = 64 * 1024; + + private const int MaxHeaderBytes = 32 * 1024; + + private static readonly char[] BadPathChars = new[] { '%', '>', '<', ':', '\\' }; + + private static readonly string[] DefaultFileNames = new[] { "default.aspx", "default.htm", "default.html" }; + + private static readonly char[] IntToHex = new[] + { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + }; + + private static readonly string[] RestrictedDirs = new[] + { + "/bin", + "/app_browsers", + "/app_code", + "/app_data", + "/app_localresources", + "/app_globalresources", + "/app_webreferences" + }; + + private readonly IStackWalk _connectionPermission = new PermissionSet(PermissionState.Unrestricted); + private readonly Host _host; + private readonly Server _server; + + private string _allRawHeaders; + + private byte[] _body; + + private int _bodyLength; + + private Connection _connection; + + private int _contentLength; + + // security permission to Assert remoting calls to _connection + private int _endHeadersOffset; + + private string _filePath; + + private byte[] _headerBytes; + + private List _headerByteStrings; + + private bool _headersSent; + + // parsed request data + + private bool _isClientScriptPath; + + private string[] _knownRequestHeaders; + + private string _path; + + private string _pathInfo; + + private string _pathTranslated; + + private string _protocol; + + private string _queryString; + private byte[] _queryStringBytes; + + private List _responseBodyBytes; + + private StringBuilder _responseHeadersBuilder; + + private int _responseStatus; + + private bool _specialCaseStaticFileHeaders; + + private int _startHeadersOffset; + + private string[][] _unknownRequestHeaders; + + private string _url; + + private string _verb; + + public Request(Server server, Host host, Connection connection) + : base(String.Empty, String.Empty, null) + { + _connectionPermission = new PermissionSet(PermissionState.Unrestricted); + _server = server; + _host = host; + _connection = connection; + } + + public override void CloseConnection() + { + _connectionPermission.Assert(); + _connection.Close(); + } + + public override void EndOfRequest() + { + Connection conn = _connection; + if (conn != null) + { + _connection = null; + _server.OnRequestEnd(conn); + } + } + + public override void FlushResponse(bool finalFlush) + { + if (_responseStatus == 404 && !_headersSent && finalFlush && _verb == "GET") + { + // attempt directory listing + if (ProcessDirectoryListingRequest()) + { + return; + } + } + + _connectionPermission.Assert(); + + if (!_headersSent) + { + _connection.WriteHeaders(_responseStatus, _responseHeadersBuilder.ToString()); + + _headersSent = true; + } + for (int i = 0; i < _responseBodyBytes.Count; i++) + { + byte[] bytes = _responseBodyBytes[i]; + _connection.WriteBody(bytes, 0, bytes.Length); + } + + _responseBodyBytes = new List(); + + if (finalFlush) + { + _connection.Close(); + } + } + + public override string GetAppPath() + { + return _host.VirtualPath; + } + + public override string GetAppPathTranslated() + { + return _host.PhysicalPath; + } + + public override string GetFilePath() + { + return _filePath; + } + + public override string GetFilePathTranslated() + { + return _pathTranslated; + } + + public override string GetHttpVerbName() + { + return _verb; + } + + public override string GetHttpVersion() + { + return _protocol; + } + + public override string GetKnownRequestHeader(int index) + { + return _knownRequestHeaders[index]; + } + + public override string GetLocalAddress() + { + _connectionPermission.Assert(); + return _connection.LocalIP; + } + + public override int GetLocalPort() + { + return _host.Port; + } + + public override string GetPathInfo() + { + return _pathInfo; + } + + public override byte[] GetPreloadedEntityBody() + { + return _body; + } + + public override string GetQueryString() + { + return _queryString; + } + + public override byte[] GetQueryStringRawBytes() + { + return _queryStringBytes; + } + + public override string GetRawUrl() + { + return _url; + } + + public override string GetRemoteAddress() + { + _connectionPermission.Assert(); + return _connection.RemoteIP; + } + + public override int GetRemotePort() + { + return 0; + } + + public override string GetServerName() + { + string localAddress = GetLocalAddress(); + if (localAddress.Equals("127.0.0.1")) + { + return "localhost"; + } + return localAddress; + } + + public override string GetServerVariable(string name) + { + string processUser = string.Empty; + string str2 = name; + if (str2 == null) + { + return processUser; + } + if (!(str2 == "ALL_RAW")) + { + if (str2 != "SERVER_PROTOCOL") + { + if (str2 == "LOGON_USER") + { + if (GetUserToken() != IntPtr.Zero) + { + processUser = _host.GetProcessUser(); + } + return processUser; + } + if ((str2 == "AUTH_TYPE") && (GetUserToken() != IntPtr.Zero)) + { + processUser = "NTLM"; + } + return processUser; + } + } + else + { + return _allRawHeaders; + } + return _protocol; + } + + public override string GetUnknownRequestHeader(string name) + { + int n = _unknownRequestHeaders.Length; + + for (int i = 0; i < n; i++) + { + if (string.Compare(name, _unknownRequestHeaders[i][0], StringComparison.OrdinalIgnoreCase) == 0) + { + return _unknownRequestHeaders[i][1]; + } + } + + return null; + } + + public override string[][] GetUnknownRequestHeaders() + { + return _unknownRequestHeaders; + } + + /////////////////////////////////////////////////////////////////////////////////////////////// + // Implementation of HttpWorkerRequest + + public override string GetUriPath() + { + return _path; + } + + public override IntPtr GetUserToken() + { + return _host.GetProcessToken(); + } + + public override bool HeadersSent() + { + return _headersSent; + } + + public override bool IsClientConnected() + { + _connectionPermission.Assert(); + return _connection.Connected; + } + + public override bool IsEntireEntityBodyIsPreloaded() + { + return (_contentLength == _bodyLength); + } + + public override string MapPath(string path) + { + string mappedPath; + bool isClientScriptPath; + + if (string.IsNullOrEmpty(path) || path.Equals("/")) + { + // asking for the site root + mappedPath = _host.VirtualPath == "/" ? _host.PhysicalPath : Environment.SystemDirectory; + } + else if (_host.IsVirtualPathAppPath(path)) + { + // application path + mappedPath = _host.PhysicalPath; + } + else if (_host.IsVirtualPathInApp(path, out isClientScriptPath)) + { + if (isClientScriptPath) + { + mappedPath = _host.PhysicalClientScriptPath + + path.Substring(_host.NormalizedClientScriptPath.Length); + } + else + { + // inside app but not the app path itself + mappedPath = _host.PhysicalPath + path.Substring(_host.NormalizedVirtualPath.Length); + } + } + else + { + // outside of app -- make relative to app path + if (path.StartsWith("/", StringComparison.Ordinal)) + { + mappedPath = _host.PhysicalPath + path.Substring(1); + } + else + { + mappedPath = _host.PhysicalPath + path; + } + } + + mappedPath = mappedPath.Replace('/', '\\'); + + if (mappedPath.EndsWith("\\", StringComparison.Ordinal) && + !mappedPath.EndsWith(":\\", StringComparison.Ordinal)) + { + mappedPath = mappedPath.Substring(0, mappedPath.Length - 1); + } + + return mappedPath; + } + + [AspNetHostingPermission(SecurityAction.Assert, Level = AspNetHostingPermissionLevel.Medium)] + public void Process() + { + // read the request + if (!TryParseRequest()) + { + return; + } + + // 100 response to POST + if (_verb == "POST" && _contentLength > 0 && _bodyLength < _contentLength) + { + _connection.Write100Continue(); + } + if (!_host.RequireAuthentication || TryNtlmAuthenticate()) + { + // special case for client script + if (_isClientScriptPath) + { + _connection.WriteEntireResponseFromFile( + _host.PhysicalClientScriptPath + _path.Substring(_host.NormalizedClientScriptPath.Length), false); + return; + } + + // deny access to code, bin, etc. + if (IsRequestForRestrictedDirectory()) + { + _connection.WriteErrorAndClose(403); + return; + } + + // special case for a request to a directory (ensure / at the end and process default documents) + if (ProcessDirectoryRequest()) + { + return; + } + + PrepareResponse(); + + // Hand the processing over to HttpRuntime + HttpRuntime.ProcessRequest(this); + } + } + + public override int ReadEntityBody(byte[] buffer, int size) + { + int bytesRead = 0; + + _connectionPermission.Assert(); + byte[] bytes = _connection.ReadRequestBytes(size); + + if (bytes != null && bytes.Length > 0) + { + bytesRead = bytes.Length; + Buffer.BlockCopy(bytes, 0, buffer, 0, bytesRead); + } + + return bytesRead; + } + + public override void SendCalculatedContentLength(int contentLength) + { + if (!_headersSent) + { + _responseHeadersBuilder.Append("Content-Length: "); + _responseHeadersBuilder.Append(contentLength.ToString(CultureInfo.InvariantCulture)); + _responseHeadersBuilder.Append("\r\n"); + } + } + + public override void SendKnownResponseHeader(int index, string value) + { + if (_headersSent) + { + return; + } + + switch (index) + { + case HeaderServer: + case HeaderDate: + case HeaderConnection: + // ignore these + return; +/* case HeaderContentType: + if (value == "bytes") + { + // use this header to detect when we're processing a static file + _specialCaseStaticFileHeaders = true; + return; + } + break; + case HeaderExpires: + case HeaderLastModified: + if (_specialCaseStaticFileHeaders) + { + // NOTE: Ignore these for static files. These are generated + // by the StaticFileHandler, but they shouldn't be. + //return; + } + break;*/ + + // FIX: #12506 + case HeaderContentType: + + string contentType = null; + + if (value == "application/octet-stream") + { + // application/octet-stream is default for unknown so lets + // take a shot at determining the type. + // don't do this for other content-types as you are going to + // end up sending text/plain for endpoints that are handled by + // asp.net such as .aspx, .asmx, .axd, etc etc + contentType = Common.GetContentType(_pathTranslated); + } + value = contentType ?? value; + break; + } + + + _responseHeadersBuilder.Append(GetKnownResponseHeaderName(index)); + _responseHeadersBuilder.Append(": "); + _responseHeadersBuilder.Append(value); + _responseHeadersBuilder.Append("\r\n"); + + } + + public override void SendResponseFromFile(string filename, long offset, long length) + { + if (length == 0) + { + return; + } + + FileStream f = null; + try + { + f = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); + SendResponseFromFileStream(f, offset, length); + } + finally + { + if (f != null) + { + f.Close(); + } + } + } + + public override void SendResponseFromFile(IntPtr handle, long offset, long length) + { + if (length == 0) + { + return; + } + + using (SafeFileHandle sfh = new SafeFileHandle(handle, false)) + { + using (FileStream f = new FileStream(sfh, FileAccess.Read)) + { + SendResponseFromFileStream(f, offset, length); + } + } + } + + public override void SendResponseFromMemory(byte[] data, int length) + { + if (length > 0) + { + byte[] bytes = new byte[length]; + + Buffer.BlockCopy(data, 0, bytes, 0, length); + _responseBodyBytes.Add(bytes); + } + } + + public override void SendStatus(int statusCode, string statusDescription) + { + _responseStatus = statusCode; + } + + public override void SendUnknownResponseHeader(string name, string value) + { + if (_headersSent) + return; + + _responseHeadersBuilder.Append(name); + _responseHeadersBuilder.Append(": "); + _responseHeadersBuilder.Append(value); + _responseHeadersBuilder.Append("\r\n"); + } + + private bool IsBadPath() + { + if (_path.IndexOfAny(BadPathChars) >= 0) + { + return true; + } + + if (CultureInfo.InvariantCulture.CompareInfo.IndexOf(_path, "..", CompareOptions.Ordinal) >= 0) + { + return true; + } + + if (CultureInfo.InvariantCulture.CompareInfo.IndexOf(_path, "//", CompareOptions.Ordinal) >= 0) + { + return true; + } + + return false; + } + + private bool IsRequestForRestrictedDirectory() + { + String p = CultureInfo.InvariantCulture.TextInfo.ToLower(_path); + + if (_host.VirtualPath != "/") + { + p = p.Substring(_host.VirtualPath.Length); + } + + foreach (String dir in RestrictedDirs) + { + if (p.StartsWith(dir, StringComparison.Ordinal)) + { + if (p.Length == dir.Length || p[dir.Length] == '/') + { + return true; + } + } + } + + return false; + } + + private void ParseHeaders() + { + _knownRequestHeaders = new string[RequestHeaderMaximum]; + + // construct unknown headers as array list of name1,value1,... + List headers = new List(); + + for (int i = 1; i < _headerByteStrings.Count; i++) + { + string s = _headerByteStrings[i].GetString(); + + int c = s.IndexOf(':'); + + if (c >= 0) + { + string name = s.Substring(0, c).Trim(); + string value = s.Substring(c + 1).Trim(); + + // remember + int knownIndex = GetKnownRequestHeaderIndex(name); + if (knownIndex >= 0) + { + _knownRequestHeaders[knownIndex] = value; + } + else + { + headers.Add(name); + headers.Add(value); + } + } + } + + // copy to array unknown headers + + int n = headers.Count / 2; + _unknownRequestHeaders = new string[n][]; + int j = 0; + + for (int i = 0; i < n; i++) + { + _unknownRequestHeaders[i] = new string[2]; + _unknownRequestHeaders[i][0] = headers[j++]; + _unknownRequestHeaders[i][1] = headers[j++]; + } + + // remember all raw headers as one string + + if (_headerByteStrings.Count > 1) + { + _allRawHeaders = Encoding.UTF8.GetString(_headerBytes, _startHeadersOffset, + _endHeadersOffset - _startHeadersOffset); + } + else + { + _allRawHeaders = String.Empty; + } + } + + private void ParsePostedContent() + { + _contentLength = 0; + _bodyLength = 0; + + string contentLengthValue = _knownRequestHeaders[HeaderContentLength]; + if (contentLengthValue != null) + { + try + { + _contentLength = Int32.Parse(contentLengthValue, CultureInfo.InvariantCulture); + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + } + + if (_headerBytes.Length > _endHeadersOffset) + { + _bodyLength = _headerBytes.Length - _endHeadersOffset; + + if (_bodyLength > _contentLength) + { + _bodyLength = _contentLength; // don't read more than the content-length + } + + if (_bodyLength > 0) + { + _body = new byte[_bodyLength]; + Buffer.BlockCopy(_headerBytes, _endHeadersOffset, _body, 0, _bodyLength); + _connection.LogRequestBody(_body); + } + } + } + + private void ParseRequestLine() + { + ByteString requestLine = _headerByteStrings[0]; + ByteString[] elems = requestLine.Split(' '); + + if (elems == null || elems.Length < 2 || elems.Length > 3) + { + _connection.WriteErrorAndClose(400); + return; + } + + _verb = elems[0].GetString(); + + ByteString urlBytes = elems[1]; + _url = urlBytes.GetString(); + + _protocol = elems.Length == 3 ? elems[2].GetString() : "HTTP/1.0"; + + // query string + + int iqs = urlBytes.IndexOf('?'); + _queryStringBytes = iqs > 0 ? urlBytes.Substring(iqs + 1).GetBytes() : new byte[0]; + + iqs = _url.IndexOf('?'); + if (iqs > 0) + { + _path = _url.Substring(0, iqs); + _queryString = _url.Substring(iqs + 1); + } + else + { + _path = _url; + _queryStringBytes = new byte[0]; + } + + // url-decode path + + if (_path.IndexOf('%') >= 0) + { + _path = HttpUtility.UrlDecode(_path, Encoding.UTF8); + + iqs = _url.IndexOf('?'); + if (iqs >= 0) + { + _url = _path + _url.Substring(iqs); + } + else + { + _url = _path; + } + } + + // path info + + int lastDot = _path.LastIndexOf('.'); + int lastSlh = _path.LastIndexOf('/'); + + if (lastDot >= 0 && lastSlh >= 0 && lastDot < lastSlh) + { + int ipi = _path.IndexOf('/', lastDot); + _filePath = _path.Substring(0, ipi); + _pathInfo = _path.Substring(ipi); + } + else + { + _filePath = _path; + _pathInfo = String.Empty; + } + + _pathTranslated = MapPath(_filePath); + + _connection.LogRequest(_pathTranslated, _url); + } + + private void PrepareResponse() + { + _headersSent = false; + _responseStatus = 200; + _responseHeadersBuilder = new StringBuilder(); + _responseBodyBytes = new List(); + } + + private bool ProcessDirectoryListingRequest() + { + if (_verb != "GET") + { + return false; + } + + String dirPathTranslated = _pathTranslated; + + if (_pathInfo.Length > 0) + { + // directory path can never have pathInfo + dirPathTranslated = MapPath(_path); + } + + if (!Directory.Exists(dirPathTranslated)) + { + return false; + } + + // get all files and subdirs + FileSystemInfo[] infos = null; + try + { + infos = (new DirectoryInfo(dirPathTranslated)).GetFileSystemInfos(); + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + + // determine if parent is appropriate + string parentPath = null; + + if (_path.Length > 1) + { + int i = _path.LastIndexOf('/', _path.Length - 2); + + parentPath = (i > 0) ? _path.Substring(0, i) : "/"; + if (!_host.IsVirtualPathInApp(parentPath)) + { + parentPath = null; + } + } + + _connection.WriteEntireResponseFromString(200, "Content-type: text/html; charset=utf-8\r\n", + Messages.FormatDirectoryListing(_path, parentPath, infos), + false); + return true; + } + + private bool ProcessDirectoryRequest() + { + String dirPathTranslated = _pathTranslated; + + if (_pathInfo.Length > 0) + { + // directory path can never have pathInfo + dirPathTranslated = MapPath(_path); + } + + if (!Directory.Exists(dirPathTranslated)) + { + return false; + } + + // have to redirect /foo to /foo/ to allow relative links to work + if (!_path.EndsWith("/", StringComparison.Ordinal)) + { + string newPath = _path + "/"; + string location = "Location: " + UrlEncodeRedirect(newPath) + "\r\n"; + string body = "Object moved\r\n" + + "

Object moved to here.

\r\n" + + "\r\n"; + + _connection.WriteEntireResponseFromString(302, location, body, false); + return true; + } + + // check for the default file + foreach (string filename in DefaultFileNames) + { + string defaultFilePath = dirPathTranslated + "\\" + filename; + + if (File.Exists(defaultFilePath)) + { + // pretend the request is for the default file path + _path += filename; + _filePath = _path; + _url = (_queryString != null) ? (_path + "?" + _queryString) : _path; + _pathTranslated = defaultFilePath; + return false; // go through normal processing + } + } + + return false; // go through normal processing + } + + private void ReadAllHeaders() + { + _headerBytes = null; + + do + { + if (!TryReadAllHeaders()) + { + // something bad happened + break; + } + } while (_endHeadersOffset < 0); // found \r\n\r\n + + // + // fixed: Item # 13290 + if (_headerByteStrings != null && _headerByteStrings.Count > 0) + { + _connection.LogRequestHeaders(string.Join(Environment.NewLine, _headerByteStrings.Select(b => b.GetString()).ToArray())); + } + + } + + private void Reset() + { + _headerBytes = null; + _startHeadersOffset = 0; + _endHeadersOffset = 0; + _headerByteStrings = null; + + _isClientScriptPath = false; + + _verb = null; + _url = null; + _protocol = null; + + _path = null; + _filePath = null; + _pathInfo = null; + _pathTranslated = null; + _queryString = null; + _queryStringBytes = null; + + _contentLength = 0; + _bodyLength = 0; + _body = null; + + _allRawHeaders = null; + _unknownRequestHeaders = null; + _knownRequestHeaders = null; + //_specialCaseStaticFileHeaders = false; + } + + private void SendResponseFromFileStream(Stream f, long offset, long length) + { + long fileSize = f.Length; + + if (length == -1) + { + length = fileSize - offset; + } + + if (length == 0 || offset < 0 || length > fileSize - offset) + { + return; + } + + if (offset > 0) + { + f.Seek(offset, SeekOrigin.Begin); + } + + if (length <= MaxChunkLength) + { + byte[] fileBytes = new byte[(int)length]; + int bytesRead = f.Read(fileBytes, 0, (int)length); + SendResponseFromMemory(fileBytes, bytesRead); + } + else + { + byte[] chunk = new byte[MaxChunkLength]; + int bytesRemaining = (int)length; + + while (bytesRemaining > 0) + { + int bytesToRead = (bytesRemaining < MaxChunkLength) ? bytesRemaining : MaxChunkLength; + int bytesRead = f.Read(chunk, 0, bytesToRead); + + SendResponseFromMemory(chunk, bytesRead); + bytesRemaining -= bytesRead; + + // flush to release keep memory + if ((bytesRemaining > 0) && (bytesRead > 0)) + { + FlushResponse(false); + } + } + } + } + + private void SkipAllPostedContent() + { + if ((_contentLength > 0) && (_bodyLength < _contentLength)) + { + byte[] buffer; + for (int i = _contentLength - _bodyLength; i > 0; i -= buffer.Length) + { + buffer = _connection.ReadRequestBytes(i); + if ((buffer == null) || (buffer.Length == 0)) + { + return; + } + } + } + } + + [SecurityPermission(SecurityAction.Assert, UnmanagedCode = true), + SecurityPermission(SecurityAction.Assert, ControlPrincipal = true)] + private bool TryNtlmAuthenticate() + { + try + { + using (NtlmAuth auth = new NtlmAuth()) + { + do + { + string blobString = null; + string extraHeaders = _knownRequestHeaders[0x18]; + if ((extraHeaders != null) && extraHeaders.StartsWith("NTLM ", StringComparison.Ordinal)) + { + blobString = extraHeaders.Substring(5); + } + if (blobString != null) + { + if (!auth.Authenticate(blobString)) + { + _connection.WriteErrorAndClose(0x193); + return false; + } + if (auth.Completed) + { + goto Label_009A; + } + extraHeaders = "WWW-Authenticate: NTLM " + auth.Blob + "\r\n"; + } + else + { + extraHeaders = "WWW-Authenticate: NTLM\r\n"; + } + SkipAllPostedContent(); + _connection.WriteErrorWithExtraHeadersAndKeepAlive(0x191, extraHeaders); + } while (TryParseRequest()); + return false; + Label_009A: + if (_host.GetProcessSid() != auth.SID) + { + _connection.WriteErrorAndClose(0x193); + return false; + } + } + } + catch + { + try + { + _connection.WriteErrorAndClose(500); + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + return false; + } + return true; + } + + /// + /// TODO: defer response until request is written + /// + /// + private bool TryParseRequest() + { + Reset(); + + ReadAllHeaders(); + + if (_headerBytes == null || _endHeadersOffset < 0 || + _headerByteStrings == null || _headerByteStrings.Count == 0) + { + _connection.WriteErrorAndClose(400); + return false; + } + + ParseRequestLine(); + + // Check for bad path + if (IsBadPath()) + { + _connection.WriteErrorAndClose(400); + return false; + } + + // Check if the path is not well formed or is not for the current app + if (!_host.IsVirtualPathInApp(_path, out _isClientScriptPath)) + { + _connection.WriteErrorAndClose(404); + return false; + } + + ParseHeaders(); + + ParsePostedContent(); + + return true; + } + + private bool TryReadAllHeaders() + { + // read the first packet (up to 32K) + byte[] headerBytes = _connection.ReadRequestBytes(MaxHeaderBytes); + + if (headerBytes == null || headerBytes.Length == 0) + return false; + + if (_headerBytes != null) + { + // previous partial read + int len = headerBytes.Length + _headerBytes.Length; + if (len > MaxHeaderBytes) + return false; + + byte[] bytes = new byte[len]; + Buffer.BlockCopy(_headerBytes, 0, bytes, 0, _headerBytes.Length); + Buffer.BlockCopy(headerBytes, 0, bytes, _headerBytes.Length, headerBytes.Length); + _headerBytes = bytes; + } + else + { + _headerBytes = headerBytes; + } + + // start parsing + _startHeadersOffset = -1; + _endHeadersOffset = -1; + _headerByteStrings = new List(); + + // find the end of headers + ByteParser parser = new ByteParser(_headerBytes); + + for (; ; ) + { + ByteString line = parser.ReadLine(); + + if (line == null) + { + break; + } + + if (_startHeadersOffset < 0) + { + _startHeadersOffset = parser.CurrentOffset; + } + + if (line.IsEmpty) + { + _endHeadersOffset = parser.CurrentOffset; + break; + } + + _headerByteStrings.Add(line); + } + + return true; + } + + private static string UrlEncodeRedirect(string path) + { + // this method mimics the logic in HttpResponse.Redirect (which relies on internal methods) + + // count non-ascii characters + byte[] bytes = Encoding.UTF8.GetBytes(path); + int count = bytes.Length; + int countNonAscii = 0; + for (int i = 0; i < count; i++) + { + if ((bytes[i] & 0x80) != 0) + { + countNonAscii++; + } + } + + // encode all non-ascii characters using UTF-8 %XX + if (countNonAscii > 0) + { + // expand not 'safe' characters into %XX, spaces to +s + byte[] expandedBytes = new byte[count + countNonAscii * 2]; + int pos = 0; + for (int i = 0; i < count; i++) + { + byte b = bytes[i]; + + if ((b & 0x80) == 0) + { + expandedBytes[pos++] = b; + } + else + { + expandedBytes[pos++] = (byte)'%'; + expandedBytes[pos++] = (byte)IntToHex[(b >> 4) & 0xf]; + expandedBytes[pos++] = (byte)IntToHex[b & 0xf]; + } + } + + path = Encoding.ASCII.GetString(expandedBytes); + } + + // encode spaces into %20 + if (path.IndexOf(' ') >= 0) + { + path = path.Replace(" ", "%20"); + } + + return path; + } + + #region Nested type: ByteParser + + internal class ByteParser + { + private readonly byte[] _bytes; + + private int _pos; + + public ByteParser(byte[] bytes) + { + _bytes = bytes; + _pos = 0; + } + + public int CurrentOffset + { + get { return _pos; } + } + + public ByteString ReadLine() + { + ByteString line = null; + + for (int i = _pos; i < _bytes.Length; i++) + { + if (_bytes[i] == (byte)'\n') + { + int len = i - _pos; + if (len > 0 && _bytes[i - 1] == (byte)'\r') + { + len--; + } + + line = new ByteString(_bytes, _pos, len); + _pos = i + 1; + return line; + } + } + + if (_pos < _bytes.Length) + { + line = new ByteString(_bytes, _pos, _bytes.Length - _pos); + } + + _pos = _bytes.Length; + return line; + } + } + + #endregion + + #region Nested type: ByteString + + internal class ByteString + { + private readonly byte[] _bytes; + + private readonly int _length; + + private readonly int _offset; + + public ByteString(byte[] bytes, int offset, int length) + { + _bytes = bytes; + _offset = offset; + _length = length; + } + + public byte[] Bytes + { + get { return _bytes; } + } + + public bool IsEmpty + { + get { return (_bytes == null || _length == 0); } + } + + public byte this[int index] + { + get { return _bytes[_offset + index]; } + } + + public int Length + { + get { return _length; } + } + + public int Offset + { + get { return _offset; } + } + + public byte[] GetBytes() + { + byte[] bytes = new byte[_length]; + if (_length > 0) Buffer.BlockCopy(_bytes, _offset, bytes, 0, _length); + return bytes; + } + + public string GetString(Encoding enc) + { + if (IsEmpty) return string.Empty; + return enc.GetString(_bytes, _offset, _length); + } + + public string GetString() + { + return GetString(Encoding.UTF8); + } + + public int IndexOf(char ch) + { + return IndexOf(ch, 0); + } + + public int IndexOf(char ch, int offset) + { + for (int i = offset; i < _length; i++) + { + if (this[i] == (byte)ch) return i; + } + return -1; + } + + public ByteString[] Split(char sep) + { + List list = new List(); + + int pos = 0; + while (pos < _length) + { + int i = IndexOf(sep, pos); + if (i < 0) + { + break; + } + + list.Add(Substring(pos, i - pos)); + pos = i + 1; + + while (this[pos] == (byte)sep && pos < _length) + { + pos++; + } + } + + if (pos < _length) + list.Add(Substring(pos)); + + return list.ToArray(); + } + + public ByteString Substring(int offset, int len) + { + return new ByteString(_bytes, _offset + offset, len); + } + + public ByteString Substring(int offset) + { + return Substring(offset, _length - offset); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/CassiniDev/Core/RequestEventArgs.cs b/CassiniDev/Core/RequestEventArgs.cs new file mode 100644 index 000000000..ac2606200 --- /dev/null +++ b/CassiniDev/Core/RequestEventArgs.cs @@ -0,0 +1,53 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using CassiniDev.ServerLog; + +#endregion + +namespace CassiniDev +{ + public class RequestEventArgs : EventArgs + { + private readonly Guid _id; + + private readonly LogInfo _requestLog; + + private readonly LogInfo _responseLog; + + public RequestEventArgs(Guid id, LogInfo requestLog, LogInfo responseLog) + { + _requestLog = requestLog; + _responseLog = responseLog; + _id = id; + } + + public Guid Id + { + get { return _id; } + } + + public LogInfo RequestLog + { + get { return _requestLog; } + } + + public LogInfo ResponseLog + { + get { return _responseLog; } + } + } +} \ No newline at end of file diff --git a/CassiniDev/Core/Server.cs b/CassiniDev/Core/Server.cs new file mode 100644 index 000000000..ff5e4791c --- /dev/null +++ b/CassiniDev/Core/Server.cs @@ -0,0 +1,523 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Reflection; +using System.Runtime.Remoting; +using System.Security.Permissions; +using System.Security.Principal; +using System.Threading; +using System.Web; +using System.Web.Hosting; +using CassiniDev.ServerLog; + +#endregion + +namespace CassiniDev +{ + [PermissionSet(SecurityAction.LinkDemand, Name = "Everything"), + PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")] + public class Server : MarshalByRefObject, IDisposable + { + private readonly ApplicationManager _appManager; + + private readonly bool _disableDirectoryListing; + + private readonly string _hostName; + + private readonly IPAddress _ipAddress; + + private readonly object _lockObject; + + private readonly string _physicalPath; + + private readonly int _port; + private readonly bool _requireAuthentication; + private readonly int _timeoutInterval; + private readonly string _virtualPath; + private bool _disposed; + + private Host _host; + + private IntPtr _processToken; + + private string _processUser; + + private int _requestCount; + + private bool _shutdownInProgress; + + private Socket _socket; + + private Timer _timer; + + public Server(int port, string virtualPath, string physicalPath) + : this(port, virtualPath, physicalPath, false, false) + { + } + + public Server(int port, string physicalPath) + : this(port, "/", physicalPath, IPAddress.Loopback) + { + } + + public Server(string physicalPath) + : this(CassiniNetworkUtils.GetAvailablePort(32768, 65535, IPAddress.Loopback, false), physicalPath) + { + } + + public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName, + int timeout, bool requireAuthentication) + : this(port, virtualPath, physicalPath, ipAddress, hostName, timeout, requireAuthentication, false) + { + } + + public Server(int port, string virtualPath, string physicalPath, bool requireAuthentication) + : this(port, virtualPath, physicalPath, requireAuthentication, false) + { + } + + public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName) + : this(port, virtualPath, physicalPath, ipAddress, hostName, 0, false, false) + { + } + + public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName, + int timeout, bool requireAuthentication, bool disableDirectoryListing) + : this(port, virtualPath, physicalPath, requireAuthentication, disableDirectoryListing) + { + _ipAddress = ipAddress; + _hostName = hostName; + _timeoutInterval = timeout; + } + + public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress) + : this(port, virtualPath, physicalPath, ipAddress, null, 0, false, false) + { + } + + public Server(int port, string virtualPath, string physicalPath, bool requireAuthentication, + bool disableDirectoryListing) + { + _ipAddress = IPAddress.Loopback; + _requireAuthentication = requireAuthentication; + _disableDirectoryListing = disableDirectoryListing; + _lockObject = new object(); + _port = port; + _virtualPath = virtualPath; + _physicalPath = Path.GetFullPath(physicalPath); + _physicalPath = _physicalPath.EndsWith("\\", StringComparison.Ordinal) + ? _physicalPath + : _physicalPath + "\\"; + _appManager = ApplicationManager.GetApplicationManager(); + ObtainProcessToken(); + } + + public Server(string physicalPath, bool requireAuthentication) + : this( + CassiniNetworkUtils.GetAvailablePort(32768, 65535, IPAddress.Loopback, false), "/", physicalPath, + requireAuthentication) + { + } + + public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName, + int timeout) + : this(port, virtualPath, physicalPath, ipAddress, hostName, timeout, false, false) + { + } + + public bool DisableDirectoryListing + { + get { return _disableDirectoryListing; } + } + + public bool RequireAuthentication + { + get { return _requireAuthentication; } + } + + public int TimeoutInterval + { + get { return _timeoutInterval; } + } + + public string HostName + { + get { return _hostName; } + } + + public IPAddress IPAddress + { + get { return _ipAddress; } + } + + public string PhysicalPath + { + get { return _physicalPath; } + } + + public int Port + { + get { return _port; } + } + + public string RootUrl + { + get + { + string hostname = _hostName; + if (string.IsNullOrEmpty(_hostName)) + { + if (_ipAddress.Equals(IPAddress.Loopback) || _ipAddress.Equals(IPAddress.IPv6Loopback) || + _ipAddress.Equals(IPAddress.Any) || _ipAddress.Equals(IPAddress.IPv6Any)) + { + hostname = "localhost"; + } + else + { + hostname = _ipAddress.ToString(); + } + } + + return _port != 80 + ? + String.Format("http://{0}:{1}{2}", hostname, _port, _virtualPath) + : + //FIX: #12017 - TODO:TEST + string.Format("http://{0}{1}", hostname, _virtualPath); + } + } + + public string VirtualPath + { + get { return _virtualPath; } + } + + #region IDisposable Members + + public void Dispose() + { + if (!_disposed) + { + ShutDown(); + } + _disposed = true; + GC.SuppressFinalize(this); + } + + #endregion + + public event EventHandler RequestComplete; + + public event EventHandler TimedOut; + + public IntPtr GetProcessToken() + { + return _processToken; + } + + public string GetProcessUser() + { + return _processUser; + } + + public void HostStopped() + { + _host = null; + } + + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.Infrastructure)] + public override object InitializeLifetimeService() + { + // never expire the license + return null; + } + + // called at the end of request processing + // to disconnect the remoting proxy for Connection object + // and allow GC to pick it up + /// + /// + /// + public void OnRequestEnd(Connection conn) + { + try + { + OnRequestComplete(conn.Id, conn.RequestLog.Clone(), conn.ResponseLog.Clone()); + } + catch + { + // swallow - we don't want consumer killing the server + } + RemotingServices.Disconnect(conn); + DecrementRequestCount(); + } + + public void Start() + { + _socket = CreateSocketBindAndListen(AddressFamily.InterNetwork, _ipAddress, _port); + + //start the timer + DecrementRequestCount(); + + ThreadPool.QueueUserWorkItem(delegate + { + while (!_shutdownInProgress) + { + try + { + Socket acceptedSocket = _socket.Accept(); + + ThreadPool.QueueUserWorkItem(delegate + { + if (!_shutdownInProgress) + { + Connection conn = new Connection(this, acceptedSocket); + + if (conn.WaitForRequestBytes() == 0) + { + conn.WriteErrorAndClose(400); + return; + } + + Host host = GetHost(); + + if (host == null) + { + conn.WriteErrorAndClose(500); + return; + } + + IncrementRequestCount(); + host.ProcessRequest(conn); + } + }); + } + catch + { + Thread.Sleep(100); + } + } + }); + } + + + ~Server() + { + Dispose(); + } + + + private static Socket CreateSocketBindAndListen(AddressFamily family, IPAddress address, int port) + { + Socket socket = new Socket(family, SocketType.Stream, ProtocolType.Tcp); + socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); + socket.Bind(new IPEndPoint(address, port)); + socket.Listen((int) SocketOptionName.MaxConnections); + return socket; + } + + /// + /// + /// + /// + /// + /// + /// + /// This is Dmitry's hack to enable running outside of GAC + private object CreateWorkerAppDomainWithHost(string virtualPath, string physicalPath, Type hostType) + { + // this creates worker app domain in a way that host doesn't need to be in GAC or bin + // using BuildManagerHost via private reflection + string uniqueAppString = string.Concat(virtualPath, physicalPath).ToLowerInvariant(); + string appId = (uniqueAppString.GetHashCode()).ToString("x", CultureInfo.InvariantCulture); + + // create BuildManagerHost in the worker app domain + //ApplicationManager appManager = ApplicationManager.GetApplicationManager(); + Type buildManagerHostType = typeof (HttpRuntime).Assembly.GetType("System.Web.Compilation.BuildManagerHost"); + IRegisteredObject buildManagerHost = _appManager.CreateObject(appId, buildManagerHostType, virtualPath, + physicalPath, false); + + // call BuildManagerHost.RegisterAssembly to make Host type loadable in the worker app domain + buildManagerHostType.InvokeMember("RegisterAssembly", + BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic, + null, + buildManagerHost, + new object[] {hostType.Assembly.FullName, hostType.Assembly.Location}); + + // create Host in the worker app domain + return _appManager.CreateObject(appId, hostType, virtualPath, physicalPath, false); + } + + private void DecrementRequestCount() + { + _requestCount--; + + if (_requestCount < 1) + { + _requestCount = 0; + + if (_timeoutInterval > 0) + { + _timer = new Timer(TimeOut, null, _timeoutInterval, Timeout.Infinite); + } + } + } + + private Host GetHost() + { + if (_shutdownInProgress) + return null; + Host host = _host; + if (host == null) + { +#if NET40 + object obj2 = new object(); + bool flag = false; + try + { + Monitor.Enter(obj2 = _lockObject, ref flag); + host = _host; + if (host == null) + { + host = (Host)CreateWorkerAppDomainWithHost(_virtualPath, _physicalPath, typeof(Host)); + host.Configure(this, _port, _virtualPath, _physicalPath, _requireAuthentication, _disableDirectoryListing); + _host = host; + } + } + finally + { + if (flag) + { + Monitor.Exit(obj2); + } + } +#else + + lock (_lockObject) + { + host = _host; + if (host == null) + { + host = (Host) CreateWorkerAppDomainWithHost(_virtualPath, _physicalPath, typeof (Host)); + host.Configure(this, _port, _virtualPath, _physicalPath, _requireAuthentication, + _disableDirectoryListing); + _host = host; + } + } + +#endif + } + + return host; + } + + private void IncrementRequestCount() + { + _requestCount++; + _timer = null; + } + + + private void ObtainProcessToken() + { + if (Interop.ImpersonateSelf(2)) + { + Interop.OpenThreadToken(Interop.GetCurrentThread(), 0xf01ff, true, ref _processToken); + Interop.RevertToSelf(); + // ReSharper disable PossibleNullReferenceException + _processUser = WindowsIdentity.GetCurrent().Name; + // ReSharper restore PossibleNullReferenceException + } + } + + private void OnRequestComplete(Guid id, LogInfo requestLog, LogInfo responseLog) + { + EventHandler complete = RequestComplete; + + if (complete != null) + { + complete(this, new RequestEventArgs(id, requestLog, responseLog)); + } + } + + + public void ShutDown() + { + _shutdownInProgress = true; + + try + { + if (_socket != null) + { + _socket.Close(); + } + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + finally + { + _socket = null; + } + + try + { + if (_host != null) + { + _host.Shutdown(); + } + + while (_host != null) + { + Thread.Sleep(100); + } + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + finally + { + _host = null; + } + } + + private void TimeOut(object ignored) + { + TimeOut(); + } + + public void TimeOut() + { + ShutDown(); + OnTimeOut(); + } + + private void OnTimeOut() + { + EventHandler handler = TimedOut; + if (handler != null) handler(this, EventArgs.Empty); + } + } +} \ No newline at end of file diff --git a/CassiniDev/Logging/LogInfo.cs b/CassiniDev/Logging/LogInfo.cs new file mode 100644 index 000000000..d36828953 --- /dev/null +++ b/CassiniDev/Logging/LogInfo.cs @@ -0,0 +1,73 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; + +#endregion + +namespace CassiniDev.ServerLog +{ + /// + /// TODO: get rid of status code and url in the database and simply parse the headers + /// + [Serializable] + public class LogInfo : ICloneable + { + public byte[] Body { get; set; } + + public Guid ConversationId { get; set; } + + public DateTime Created { get; set; } + + public string Exception { get; set; } + + public string Headers { get; set; } + + public string Identity { get; set; } + + public string PathTranslated { get; set; } + + public string PhysicalPath { get; set; } + + public long RowId { get; set; } + + public long RowType { get; set; } + + public long? StatusCode { get; set; } + + public string Url { get; set; } + + #region ICloneable Members + + object ICloneable.Clone() + { + return MemberwiseClone(); + } + + #endregion + + public LogInfo Clone() + { + LogInfo result = (LogInfo) ((ICloneable) this).Clone(); + if (Body != null) + { + result.Body = new byte[Body.Length]; + Body.CopyTo(result.Body, 0); + } + + return result; + } + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/CommandLine.cs b/CassiniDev/Misc/CommandLine.cs new file mode 100644 index 000000000..55798ee7c --- /dev/null +++ b/CassiniDev/Misc/CommandLine.cs @@ -0,0 +1,100 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections; +using System.Collections.Specialized; + +#endregion + +namespace CassiniDev.UIComponents +{ + public sealed class CommandLine + { + #region Fields + + private readonly string[] _arguments; + + private readonly bool _showHelp; + private IDictionary _options; + + #endregion + + #region Constructors + + public CommandLine(string[] args) + { + ArrayList list = new ArrayList(); + for (int i = 0; i < args.Length; i++) + { + char ch = args[i][0]; + if ((ch != '/') && (ch != '-')) + { + list.Add(args[i]); + } + else + { + int index = args[i].IndexOf(':'); + if (index == -1) + { + string strA = args[i].Substring(1); + if ((string.Compare(strA, "help", StringComparison.OrdinalIgnoreCase) == 0) || strA.Equals("?")) + { + _showHelp = true; + } + else + { + Options[strA] = string.Empty; + } + } + else + { + Options[args[i].Substring(1, index - 1)] = args[i].Substring(index + 1); + } + } + } + _arguments = (string[]) list.ToArray(typeof (string)); + } + + #endregion + + #region Properties + + public string[] Arguments + { + get { return _arguments; } + } + + public IDictionary Options + { + get + { + if (_options == null) + { + _options = new HybridDictionary(true); + } + return _options; + } + } + + public bool ShowHelp + { + get { return _showHelp; } + } + + #endregion + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/CommandLineArguments.cs b/CassiniDev/Misc/CommandLineArguments.cs new file mode 100644 index 000000000..a80d95658 --- /dev/null +++ b/CassiniDev/Misc/CommandLineArguments.cs @@ -0,0 +1,443 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Text; +using System.Threading; + +#endregion + +namespace CassiniDev +{ + /// + /// Command line arguments + /// + /// fixed 5/24/10 - quoted embedded spaces in ToString + /// + public class CommandLineArguments + { + #region Properties + + [Argument(ArgumentType.AtMostOnce, ShortName = "ah", DefaultValue = false, + HelpText = "If true add entry to Windows hosts file. Requires write permissions to hosts file.")] public + bool AddHost; + + [Argument(ArgumentType.AtMostOnce, ShortName = "a", LongName = "path", + HelpText = "Physical location of content.")] public string + ApplicationPath; + + [Argument(ArgumentType.AtMostOnce, LongName = "log", DefaultValue = false, HelpText = "Enable logging.")] public + bool EnableLogging; + + [Argument(ArgumentType.AtMostOnce, ShortName = "h", LongName = "host", + HelpText = "Host name used for app root url. Optional unless AddHost is true.")] public string HostName; + + [Argument(ArgumentType.AtMostOnce, ShortName = "i", LongName = "ip", + HelpText = "IP address to listen to. Ignored if IPMode != Specific")] public string IPAddress; + + [Argument(ArgumentType.AtMostOnce, ShortName = "im", DefaultValue = IPMode.Loopback, HelpText = "", + LongName = "ipMode")] public + IPMode IPMode; + + [Argument(ArgumentType.AtMostOnce, ShortName = "v6", DefaultValue = false, + HelpText = "If IPMode 'Any' or 'LoopBack' are specified use the V6 address", LongName = "ipV6")] public bool + IPv6; + + + [Argument(ArgumentType.AtMostOnce, LongName = "nodirlist", DefaultValue = false, + HelpText = "Disable diretory listing")] public bool Nodirlist; + + [Argument(ArgumentType.AtMostOnce, LongName = "ntlm", DefaultValue = false, HelpText = "Run as current identity" + )] public bool Ntlm; + + + [Argument(ArgumentType.AtMostOnce, ShortName = "p", LongName = "port", + HelpText = "Port to listen to. Ignored if PortMode=FirstAvailable.", DefaultValue = 0)] public int Port; + + [Argument(ArgumentType.AtMostOnce, ShortName = "pm", HelpText = "", LongName = "portMode", + DefaultValue = PortMode.FirstAvailable)] public PortMode PortMode; + + [Argument(ArgumentType.AtMostOnce, ShortName = "pre", DefaultValue = 65535, LongName = "highPort", + HelpText = "End of port range. Ignored if PortMode != FirstAvailable")] public int PortRangeEnd = 9000; + + [Argument(ArgumentType.AtMostOnce, ShortName = "prs", DefaultValue = 32768, LongName = "lowPort", + HelpText = "Start of port range. Ignored if PortMode != FirstAvailable")] public int PortRangeStart = + 8080; + + [DefaultArgument(ArgumentType.AtMostOnce, DefaultValue = RunMode.Server, HelpText = "[Server|Hostsfile]")] public RunMode RunMode; + [Argument(ArgumentType.AtMostOnce, LongName = "silent", DefaultValue = false, HelpText = "Fail silently")] public bool Silent; + + [Argument(ArgumentType.AtMostOnce, ShortName = "t", DefaultValue = 0, LongName = "timeout", + HelpText = "Length of time, in ms, to wait for a request before stopping the server. 0 = no timeout.")] public int TimeOut; + + [Argument(ArgumentType.AtMostOnce, ShortName = "v", LongName = "vpath", DefaultValue = "/", + HelpText = "Optional. default value '/'" + )] public string VirtualPath = "/"; + + [Argument(ArgumentType.AtMostOnce, ShortName = "vs", DefaultValue = false, + HelpText = "If true run in Visual Studio Development Server mode - readonly UI with single option to quit.." + )] public + bool VisualStudio; + + [Argument(ArgumentType.AtMostOnce, ShortName = "w", DefaultValue = 0, LongName = "wait", + HelpText = + "Length of time, in ms, to wait for a specific port before throwing an exception or exiting. 0 = don't wait." + )] public int WaitForPort; + + #endregion + + public string[] ToArgs() + { + List result = new List(); + if (RunMode != RunMode.Server) + { + result.Add(string.Format("{0}", RunMode)); + } + if (!string.IsNullOrEmpty(ApplicationPath)) + { + result.Add(string.Format("/a:{0}", ApplicationPath.Contains("") ? String.Format("\"{0}\"", ApplicationPath) : ApplicationPath)); + } + result.Add(string.Format("/v:{0}", VirtualPath.Contains("") ? String.Format("\"{0}\"", VirtualPath) : VirtualPath)); + + if (!string.IsNullOrEmpty(HostName)) + { + result.Add(string.Format("/h:{0}", HostName.Contains("") ? String.Format("\"{0}\"", HostName) : HostName)); + } + if (AddHost) + { + result.Add("/ah"); + } + + if (IPMode != IPMode.Loopback) + { + result.Add(string.Format("/im:{0}", IPMode)); + } + + if (!string.IsNullOrEmpty(IPAddress)) + { + result.Add(string.Format("/i:{0}", IPAddress)); + } + + if (IPv6) + { + result.Add("/v6"); + } + + if (VisualStudio) + { + result.Add("/vs"); + } + + if (PortMode != PortMode.FirstAvailable) + { + result.Add(string.Format("/pm:{0}", PortMode)); + } + + if (Port != 0) + { + result.Add(string.Format("/p:{0}", Port)); + } + + if (PortRangeStart != 32768) + { + result.Add(string.Format("/prs:{0}", PortRangeStart)); + } + if (PortRangeEnd != 65535) + { + result.Add(string.Format("/pre:{0}", PortRangeEnd)); + } + if (TimeOut > 0) + { + result.Add(string.Format("/t:{0}", TimeOut)); + } + if (WaitForPort > 0) + { + result.Add(string.Format("/w:{0}", WaitForPort)); + } + + if (Ntlm) + { + result.Add("/ntlm"); + } + if (Silent) + { + result.Add("/silent"); + } + if (Nodirlist) + { + result.Add("/nodirlist"); + } + if (EnableLogging) + { + result.Add("/log"); + } + + return result.ToArray(); + } + public override string ToString() + { + return string.Join(" ", ToArgs()); + //StringBuilder sb = new StringBuilder(); + //if (RunMode != RunMode.Server) + //{ + // sb.AppendFormat("{0}", RunMode); + //} + //if (!string.IsNullOrEmpty(ApplicationPath)) + //{ + // sb.AppendFormat(" /a:{0}", ApplicationPath.Contains(" ") ? String.Format("\"{0}\"", ApplicationPath) : ApplicationPath); + //} + //sb.AppendFormat(" /v:{0}", VirtualPath.Contains(" ") ? String.Format("\"{0}\"", VirtualPath) : VirtualPath); + + //if (!string.IsNullOrEmpty(HostName)) + //{ + // sb.AppendFormat(" /h:{0}", HostName.Contains(" ") ? String.Format("\"{0}\"", HostName) : HostName); + //} + //if (AddHost) + //{ + // sb.Append(" /ah"); + //} + + //if (IPMode != IPMode.Loopback) + //{ + // sb.AppendFormat(" /im:{0}", IPMode); + //} + + //if (!string.IsNullOrEmpty(IPAddress)) + //{ + // sb.AppendFormat(" /i:{0}", IPAddress); + //} + + //if (IPv6) + //{ + // sb.Append(" /v6"); + //} + + //if (VisualStudio) + //{ + // sb.Append(" /vs"); + //} + + //if (PortMode != PortMode.FirstAvailable) + //{ + // sb.AppendFormat(" /pm:{0}", PortMode); + //} + + //if (Port != 0) + //{ + // sb.AppendFormat(" /p:{0}", Port); + //} + + //if (PortRangeStart != 32768) + //{ + // sb.AppendFormat(" /prs:{0}", PortRangeStart); + //} + //if (PortRangeEnd != 65535) + //{ + // sb.AppendFormat(" /pre:{0}", PortRangeEnd); + //} + //if (TimeOut > 0) + //{ + // sb.AppendFormat(" /t:{0}", TimeOut); + //} + //if (WaitForPort > 0) + //{ + // sb.AppendFormat(" /w:{0}", WaitForPort); + //} + + //if (Ntlm) + //{ + // sb.Append(" /ntlm"); + //} + //if (Silent) + //{ + // sb.Append(" /silent"); + //} + //if (Nodirlist) + //{ + // sb.Append(" /nodirlist"); + //} + //if (EnableLogging) + //{ + // sb.Append(" /log"); + //} + //return sb.ToString().Trim(); + } + + /// + /// + internal void Validate() + { + if (string.IsNullOrEmpty(ApplicationPath)) + { + throw new CassiniException(SR.ErrApplicationPathIsNull, ErrorField.ApplicationPath); + } + + try + { + ApplicationPath = Path.GetFullPath(ApplicationPath); + } + catch + { + } + if (!Directory.Exists(ApplicationPath)) + { + throw new CassiniException(SR.WebdevDirNotExist, ErrorField.ApplicationPath); + } + + ApplicationPath = ApplicationPath.Trim('\"').TrimEnd('\\'); + + + if (!string.IsNullOrEmpty(VirtualPath)) + { + VirtualPath = VirtualPath.Trim('\"'); + VirtualPath = VirtualPath.Trim('/'); + VirtualPath = "/" + VirtualPath; + } + else + { + VirtualPath = "/"; + } + + + if (!VirtualPath.StartsWith("/")) + { + VirtualPath = "/" + VirtualPath; + } + + + if (AddHost && string.IsNullOrEmpty(HostName)) + { + throw new CassiniException(SR.ErrInvalidHostname, ErrorField.HostName); + } + + + IPAddress = ParseIP(IPMode, IPv6, IPAddress).ToString(); + + + if (VisualStudio) // then STOP HERE. + { + // It is fortunate that in order to provide api parity with WebDev + // we do not need to port scan. Visual Studio balks and refuses to + // attach if we monkey around and open ports. + Port = Port == 0 ? 80 : Port; + PortMode = PortMode.Specific; + return; + } + + + switch (PortMode) + { + case PortMode.FirstAvailable: + + if (PortRangeStart < 1) + { + throw new CassiniException(SR.ErrInvalidPortRangeValue, ErrorField.PortRangeStart); + } + + if (PortRangeEnd < 1) + { + throw new CassiniException(SR.ErrInvalidPortRangeValue, ErrorField.PortRangeEnd); + } + + if (PortRangeStart > PortRangeEnd) + { + throw new CassiniException(SR.ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta, + ErrorField.PortRange); + } + Port = CassiniNetworkUtils.GetAvailablePort(PortRangeStart, PortRangeEnd, + System.Net.IPAddress.Parse(IPAddress), true); + + if (Port == 0) + { + throw new CassiniException(SR.ErrNoAvailablePortFound, ErrorField.PortRange); + } + + break; + + case PortMode.Specific: + + if ((Port < 1) || (Port > 0xffff)) + { + throw new CassiniException(SR.ErrPortOutOfRange, ErrorField.Port); + } + + + // start waiting.... + //TODO: design this hack away.... why am I waiting in a validation method? + int now = Environment.TickCount; + + // wait until either 1) the specified port is available or 2) the specified amount of time has passed + while (Environment.TickCount < now + WaitForPort && + CassiniNetworkUtils.GetAvailablePort(Port, Port, System.Net.IPAddress.Parse(IPAddress), true) != + Port) + { + Thread.Sleep(100); + } + + // is the port available? + if (CassiniNetworkUtils.GetAvailablePort(Port, Port, System.Net.IPAddress.Parse(IPAddress), true) != + Port) + { + throw new CassiniException(SR.ErrPortIsInUse, ErrorField.Port); + } + + + break; + default: + + throw new CassiniException(SR.ErrInvalidPortMode, ErrorField.None); + } + } + + + /// + /// Converts CommandLineArgument values to an IP address if possible. + /// Throws Exception if not. + /// + /// + /// + /// + /// + /// If IPMode is invalid + /// If IPMode is 'Specific' and ipString is invalid + public static IPAddress ParseIP(IPMode ipmode, bool v6, string ipString) + { + IPAddress ip; + switch (ipmode) + { + case IPMode.Loopback: + + ip = v6 ? System.Net.IPAddress.IPv6Loopback : System.Net.IPAddress.Loopback; + break; + case IPMode.Any: + ip = v6 ? System.Net.IPAddress.IPv6Any : System.Net.IPAddress.Any; + break; + case IPMode.Specific: + + if (!System.Net.IPAddress.TryParse(ipString, out ip)) + { + throw new CassiniException(SR.ErrInvalidIPAddress, ErrorField.IPAddress); + } + break; + default: + throw new CassiniException(SR.ErrInvalidIPMode, ErrorField.None); + } + return ip; + } + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/CommandLineParser.cs b/CassiniDev/Misc/CommandLineParser.cs new file mode 100644 index 000000000..0aa1bb4e1 --- /dev/null +++ b/CassiniDev/Misc/CommandLineParser.cs @@ -0,0 +1,1585 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; + +#endregion + +namespace CassiniDev +{ + /// + /// Parser for command line arguments. + /// + /// The parser specification is infered from the instance fields of the object + /// specified as the destination of the parse. + /// Valid argument types are: int, uint, string, bool, enums + /// Also argument types of Array of the above types are also valid. + /// + /// Error checking options can be controlled by adding a ArgumentAttribute + /// to the instance fields of the destination object. + /// + /// At most one field may be marked with the DefaultArgumentAttribute + /// indicating that arguments without a '-' or '/' prefix will be parsed as that argument. + /// + /// If not specified then the parser will infer default options for parsing each + /// instance field. The default long name of the argument is the field name. The + /// default short name is the first character of the long name. Long names and explicitly + /// specified short names must be unique. Default short names will be used provided that + /// the default short name does not conflict with a long name or an explicitly + /// specified short name. + /// + /// Arguments which are array types are collection arguments. Collection + /// arguments can be specified multiple times. + /// + /// + /// Usage + /// ----- + /// + /// Parsing command line arguments to a console application is a common problem. + /// This library handles the common task of reading arguments from a command line + /// and filling in the values in a type. + /// + /// To use this library, define a class whose fields represent the data that your + /// application wants to receive from arguments on the command line. Then call + /// CommandLine.ParseArguments() to fill the object with the data + /// from the command line. Each field in the class defines a command line argument. + /// The type of the field is used to validate the data read from the command line. + /// The name of the field defines the name of the command line option. + /// + /// The parser can handle fields of the following types: + /// + /// - string + /// - int + /// - uint + /// - bool + /// - enum + /// - array of the above type + /// + /// For example, suppose you want to read in the argument list for wc (word count). + /// wc takes three optional boolean arguments: -l, -w, and -c and a list of files. + /// + /// You could parse these arguments using the following code: + /// + /// class WCArguments + /// { + /// public bool lines; + /// public bool words; + /// public bool chars; + /// public string[] files; + /// } + /// + /// class WC + /// { + /// static void Main(string[] args) + /// { + /// if (CommandLine.ParseArgumentsWithUsage(args, parsedArgs)) + /// { + /// // insert application code here + /// } + /// } + /// } + /// + /// So you could call this aplication with the following command line to count + /// lines in the foo and bar files: + /// + /// wc.exe /lines /files:foo /files:bar + /// + /// The program will display the following usage message when bad command line + /// arguments are used: + /// + /// wc.exe -x + /// + /// Unrecognized command line argument '-x' + /// /lines[+|-] short form /l + /// /words[+|-] short form /w + /// /chars[+|-] short form /c + /// /files:<string> short form /f + /// @<file> Read response file for more options + /// + /// That was pretty easy. However, you realy want to omit the "/files:" for the + /// list of files. The details of field parsing can be controled using custom + /// attributes. The attributes which control parsing behaviour are: + /// + /// ArgumentAttribute + /// - controls short name, long name, required, allow duplicates, default value + /// and help text + /// DefaultArgumentAttribute + /// - allows omition of the "/name". + /// - This attribute is allowed on only one field in the argument class. + /// + /// So for the wc.exe program we want this: + /// + /// using System; + /// using Utilities; + /// + /// class WCArguments + /// { + /// [Argument(ArgumentType.AtMostOnce, HelpText="Count number of lines in the input text.")] + /// public bool lines; + /// [Argument(ArgumentType.AtMostOnce, HelpText="Count number of words in the input text.")] + /// public bool words; + /// [Argument(ArgumentType.AtMostOnce, HelpText="Count number of chars in the input text.")] + /// public bool chars; + /// [DefaultArgument(ArgumentType.MultipleUnique, HelpText="Input files to count.")] + /// public string[] files; + /// } + /// + /// class WC + /// { + /// static void Main(string[] args) + /// { + /// WCArguments parsedArgs = new WCArguments(); + /// if (CommandLine.ParseArgumentsWithUsage(args, parsedArgs)) + /// { + /// // insert application code here + /// } + /// } + /// } + /// + /// + /// + /// So now we have the command line we want: + /// + /// wc.exe /lines foo bar + /// + /// This will set lines to true and will set files to an array containing the + /// strings "foo" and "bar". + /// + /// The new usage message becomes: + /// + /// wc.exe -x + /// + /// Unrecognized command line argument '-x' + /// /lines[+|-] Count number of lines in the input text. (short form /l) + /// /words[+|-] Count number of words in the input text. (short form /w) + /// /chars[+|-] Count number of chars in the input text. (short form /c) + /// @<file> Read response file for more options + /// <files> Input files to count. (short form /f) + /// + /// If you want more control over how error messages are reported, how /help is + /// dealt with, etc you can instantiate the CommandLine.Parser class. + /// + /// + /// + /// Cheers, + /// Peter Hallam + /// C# Compiler Developer + /// Microsoft Corp. + /// + /// + /// + /// + /// Release Notes + /// ------------- + /// + /// 10/02/2002 Initial Release + /// 10/14/2002 Bug Fix + /// 01/08/2003 Bug Fix in @ include files + /// 10/23/2004 Added user specified help text, formatting of help text to + /// screen width. Added ParseHelp for /?. + /// 11/23/2004 Added support for default values. + /// 02/23/2005 Fix bug with short name and default arguments. + /// + /// 12/24/2009 sky: Added ushort as valid argument type. + /// 12/27/2009 sky: todo: expose out and err to enable use in forms app. + /// 12/29/2009 sky: added ArgumentsAttribute and GetGenericUsageString to allow attaching generic help text + /// 01/01/2010 sky: split classes into seperate files + /// 01/01/2010 sky: cleaned up Parser.cs + /// 05/22/2010 sky: major cleanup - more to come. + /// + public sealed class CommandLineParser + { + /// + /// The System Defined new line string. + /// + public const string NewLine = "\r\n"; + + private const int SpaceBeforeParam = 2; + + private const int StdOutputHandle = -11; + + private readonly Hashtable _argumentMap; + + private readonly ArrayList _arguments; + + private readonly Type _argumentSpecification; + + private readonly Argument _defaultArgument; + + private readonly ErrorReporter _reporter; + + /// + /// Don't ever call this. + /// + // ReSharper disable UnusedMember.Local + private CommandLineParser() + // ReSharper restore UnusedMember.Local + { + //noop + } + + /// + /// Creates a new command line argument parser. + /// + /// The type of object to parse. + /// The destination for parse errors. + public CommandLineParser(Type argumentSpecification, ErrorReporter reporter) + { + _argumentSpecification = argumentSpecification; + _reporter = reporter; + _arguments = new ArrayList(); + _argumentMap = new Hashtable(); + + foreach (FieldInfo field in argumentSpecification.GetFields()) + { + if (!field.IsStatic && !field.IsInitOnly && !field.IsLiteral) + { + ArgumentAttribute attribute = GetAttribute(field); + if (attribute is DefaultArgumentAttribute) + { + Debug.Assert(_defaultArgument == null); + _defaultArgument = new Argument(attribute, field, reporter); + } + else + { + _arguments.Add(new Argument(attribute, field, reporter)); + } + } + } + + // add explicit names to map + foreach (Argument argument in _arguments) + { + Debug.Assert(!_argumentMap.ContainsKey(argument.LongName)); + _argumentMap[argument.LongName] = argument; + if (argument.ExplicitShortName) + { + if (!string.IsNullOrEmpty(argument.ShortName)) + { + Debug.Assert(!_argumentMap.ContainsKey(argument.ShortName)); + _argumentMap[argument.ShortName] = argument; + } + else + { + argument.ClearShortName(); + } + } + } + + // add implicit names which don't collide to map + foreach (Argument argument in _arguments) + { + if (!argument.ExplicitShortName) + { + if (!string.IsNullOrEmpty(argument.ShortName) && !_argumentMap.ContainsKey(argument.ShortName)) + _argumentMap[argument.ShortName] = argument; + else + argument.ClearShortName(); + } + } + } + + /// + /// Does this parser have a default argument. + /// + /// Does this parser have a default argument. + public bool HasDefaultArgument + { + get { return _defaultArgument != null; } + } + + /// + /// Returns a Usage string for command line argument parsing. + /// Use ArgumentAttributes to control parsing behaviour. + /// Formats the output to the width of the current console window. + /// + /// The type of the arguments to display usage for. + /// Printable string containing a user friendly description of command line arguments. + public static string ArgumentsUsage(Type argumentType) + { + int screenWidth = GetConsoleWindowWidth(); + if (screenWidth == 0) + screenWidth = 80; + return ArgumentsUsage(argumentType, screenWidth); + } + + /// + /// Returns a Usage string for command line argument parsing. + /// Use ArgumentAttributes to control parsing behaviour. + /// + /// The type of the arguments to display usage for. + /// The number of columns to format the output to. + /// Printable string containing a user friendly description of command line arguments. + public static string ArgumentsUsage(Type argumentType, int columns) + { + return (new CommandLineParser(argumentType, null)).GetUsageString(columns); + } + + /// + /// Returns the number of columns in the current console window + /// + /// Returns the number of columns in the current console window + public static int GetConsoleWindowWidth() + { + Interop.CONSOLE_SCREEN_BUFFER_INFO csbi = new Interop.CONSOLE_SCREEN_BUFFER_INFO(); + +#pragma warning disable 168 + int rc = Interop.GetConsoleScreenBufferInfo(Interop.GetStdHandle(StdOutputHandle), ref csbi); +#pragma warning restore 168 + int screenWidth = csbi.dwSize.x; + return screenWidth; + } + + /// + /// A user firendly usage string describing the command line argument syntax. + /// + public string GetUsageString(int screenWidth) + { + ArgumentHelpStrings[] strings = GetAllHelpStrings(); + + int maxParamLen = 0; + foreach (ArgumentHelpStrings helpString in strings) + { + maxParamLen = Math.Max(maxParamLen, helpString.syntax.Length); + } + + const int minimumNumberOfCharsForHelpText = 10; + const int minimumHelpTextColumn = 5; + const int minimumScreenWidth = minimumHelpTextColumn + minimumNumberOfCharsForHelpText; + + int idealMinimumHelpTextColumn = maxParamLen + SpaceBeforeParam; + screenWidth = Math.Max(screenWidth, minimumScreenWidth); + int helpTextColumn = screenWidth < (idealMinimumHelpTextColumn + minimumNumberOfCharsForHelpText) + ? minimumHelpTextColumn + : idealMinimumHelpTextColumn; + + const string newLine = "\n"; + StringBuilder builder = new StringBuilder(); + + // 01/01/2010 sky + string genericUsage = GetGenericUsageString(_argumentSpecification, screenWidth); + if (!string.IsNullOrEmpty(genericUsage)) + { + builder.AppendLine(genericUsage); + } + + foreach (ArgumentHelpStrings helpStrings in strings) + { + // add syntax string + int syntaxLength = helpStrings.syntax.Length; + builder.Append(helpStrings.syntax); + + // start help text on new line if syntax string is too long + int currentColumn = syntaxLength; + if (syntaxLength >= helpTextColumn) + { + builder.Append(newLine); + currentColumn = 0; + } + + // add help text broken on spaces + int charsPerLine = screenWidth - helpTextColumn; + int index = 0; + while (index < helpStrings.help.Length) + { + // tab to start column + builder.Append(' ', helpTextColumn - currentColumn); + currentColumn = helpTextColumn; + + // find number of chars to display on this line + int endIndex = index + charsPerLine; + if (endIndex >= helpStrings.help.Length) + { + // rest of text fits on this line + endIndex = helpStrings.help.Length; + } + else + { + endIndex = helpStrings.help.LastIndexOf(' ', endIndex - 1, + Math.Min(endIndex - index, charsPerLine)); + if (endIndex <= index) + { + // no spaces on this line, append full set of chars + endIndex = index + charsPerLine; + } + } + + // add chars + builder.Append(helpStrings.help, index, endIndex - index); + index = endIndex; + + // do new line + AddNewLine(newLine, builder, ref currentColumn); + + // don't start a new line with spaces + while (index < helpStrings.help.Length && helpStrings.help[index] == ' ') + index++; + } + + // add newline if there's no help text + if (helpStrings.help.Length == 0) + { + builder.Append(newLine); + } + } + + return builder.ToString(); + } + + /// + /// Searches a StringBuilder for a character + /// + /// The text to search. + /// The character value to search for. + /// The index to stat searching at. + /// The index of the first occurence of value or -1 if it is not found. + public static int IndexOf(StringBuilder text, char value, int startIndex) + { + for (int index = startIndex; index < text.Length; index++) + { + if (text[index] == value) + return index; + } + + return -1; + } + + /// + /// Searches a StringBuilder for a character in reverse + /// + /// The text to search. + /// The character to search for. + /// The index to start the search at. + /// The index of the last occurence of value in text or -1 if it is not found. + public static int LastIndexOf(StringBuilder text, char value, int startIndex) + { + for (int index = Math.Min(startIndex, text.Length - 1); index >= 0; index--) + { + if (text[index] == value) + return index; + } + + return -1; + } + + /// + /// Parses an argument list. + /// + /// The arguments to parse. + /// The destination of the parsed arguments. + /// true if no parse errors were encountered. + public bool Parse(string[] args, object destination) + { + bool hadError = ParseArgumentList(args, destination); + + // check for missing required arguments + foreach (Argument arg in _arguments) + { + hadError |= arg.Finish(destination); + } + if (_defaultArgument != null) + { + hadError |= _defaultArgument.Finish(destination); + } + + return !hadError; + } + + /// + /// Parses Command Line Arguments. + /// Errors are output on Console.Error. + /// Use ArgumentAttributes to control parsing behaviour. + /// + /// The actual arguments. + /// The resulting parsed arguments. + /// true if no errors were detected. + public static bool ParseArguments(string[] arguments, object destination) + { + return ParseArguments(arguments, destination, Console.Error.WriteLine); + } + + /// + /// Parses Command Line Arguments. + /// Use ArgumentAttributes to control parsing behaviour. + /// + /// The actual arguments. + /// The resulting parsed arguments. + /// The destination for parse errors. + /// true if no errors were detected. + public static bool ParseArguments(string[] arguments, object destination, ErrorReporter reporter) + { + CommandLineParser parser = new CommandLineParser(destination.GetType(), reporter); + return parser.Parse(arguments, destination); + } + + /// + /// Parses Command Line Arguments. Displays usage message to Console.Out + /// if /?, /help or invalid arguments are encounterd. + /// Errors are output on Console.Error. + /// Use ArgumentAttributes to control parsing behaviour. + /// + /// The actual arguments. + /// The resulting parsed arguments. + /// true if no errors were detected. + public static bool ParseArgumentsWithUsage(string[] arguments, object destination) + { + if (ParseHelp(arguments) || !ParseArguments(arguments, destination)) + { + // error encountered in arguments. Display usage message + Console.Write(ArgumentsUsage(destination.GetType())); + return false; + } + + return true; + } + + /// + /// Checks if a set of arguments asks for help. + /// + /// Args to check for help. + /// Returns true if args contains /? or /help. + public static bool ParseHelp(string[] args) + { + CommandLineParser helpParser = new CommandLineParser(typeof (HelpArgument), NullErrorReporter); + HelpArgument helpArgument = new HelpArgument(); + helpParser.Parse(args, helpArgument); + return helpArgument.help; + } + + private static void AddNewLine(string newLine, StringBuilder builder, ref int currentColumn) + { + builder.Append(newLine); + currentColumn = 0; + } + + private static object DefaultValue(ArgumentAttribute attribute) + { + return (attribute == null || !attribute.HasDefaultValue) ? null : attribute.DefaultValue; + } + + private static Type ElementType(FieldInfo field) + { + return IsCollectionType(field.FieldType) ? field.FieldType.GetElementType() : null; + } + + private static bool ExplicitShortName(ArgumentAttribute attribute) + { + return (attribute != null && !attribute.DefaultShortName); + } + + private static ArgumentType Flags(ArgumentAttribute attribute, FieldInfo field) + { + if (attribute != null) + { + return attribute.Type; + } + + return IsCollectionType(field.FieldType) ? ArgumentType.MultipleUnique : ArgumentType.AtMostOnce; + } + + private ArgumentHelpStrings[] GetAllHelpStrings() + { + ArgumentHelpStrings[] strings = new ArgumentHelpStrings[NumberOfParametersToDisplay()]; + + int index = 0; + foreach (Argument arg in _arguments) + { + strings[index] = GetHelpStrings(arg); + index++; + } + strings[index++] = new ArgumentHelpStrings("@", "Read response file for more options"); + if (_defaultArgument != null) + { + strings[index] = GetHelpStrings(_defaultArgument); + } + + return strings; + } + + private static ArgumentAttribute GetAttribute(ICustomAttributeProvider field) + { + object[] attributes = field.GetCustomAttributes(typeof (ArgumentAttribute), false); + if (attributes.Length == 1) + return (ArgumentAttribute) attributes[0]; + + Debug.Assert(attributes.Length == 0); + return null; + } + + /// + /// 01/01/2010 sky + /// + private static string GetGenericUsageString(ICustomAttributeProvider type, int cols) + { + object[] attributes = type.GetCustomAttributes(typeof (ArgumentsAttribute), true); + if (attributes.Length == 0 || !((ArgumentsAttribute) attributes[0]).HasHelpText) + { + return string.Empty; + } + + StringBuilder sb = new StringBuilder(); + string usage = ((ArgumentsAttribute) attributes[0]).HelpText; + // simple width formatter + string[] lines = Regex.Split(usage, Environment.NewLine); + foreach (string line in lines) + { + string[] words = Regex.Split(line, " "); + string currentLine = string.Empty; + foreach (string word in words) + { + if (currentLine.Length + word.Length + 1 > cols) + { + // start new line + sb.AppendLine(currentLine); + currentLine = word + " "; + } + else + { + currentLine += (word + " "); + } + } + sb.AppendLine(currentLine); + sb.Append(Environment.NewLine); + } + return sb.ToString(); + } + + private static ArgumentHelpStrings GetHelpStrings(Argument arg) + { + return new ArgumentHelpStrings(arg.SyntaxHelp, arg.FullHelpText); + } + + private static bool HasHelpText(ArgumentAttribute attribute) + { + return (attribute != null && attribute.HasHelpText); + } + + private static string HelpText(ArgumentAttribute attribute) + { + return attribute == null ? null : attribute.HelpText; + } + + private static bool IsCollectionType(Type type) + { + return type.IsArray; + } + + private static bool IsValidElementType(Type type) + { + //SKY:12/25/09 - added ushort + return type != null && ( + type == typeof (int) || + type == typeof (uint) || + type == typeof (ushort) || + type == typeof (string) || + type == typeof (bool) || + type.IsEnum); + } + + private bool LexFileArguments(string fileName, out string[] argumentsOut) + { + string args; + + try + { + using (FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read)) + { + args = (new StreamReader(file)).ReadToEnd(); + } + } + catch (Exception e) + { + _reporter(string.Format("Error: Can't open command line argument file '{0}' : '{1}'", fileName, + e.Message)); + argumentsOut = null; + return false; + } + + bool hadError = false; + ArrayList argArray = new ArrayList(); + StringBuilder currentArg = new StringBuilder(); + bool inQuotes = false; + int index = 0; + + // while (index < args.Length) + try + { + while (true) + { + // skip whitespace + while (char.IsWhiteSpace(args[index])) + { + index += 1; + } + + // # - comment to end of line + if (args[index] == '#') + { + index += 1; + while (args[index] != '\n') + { + index += 1; + } + continue; + } + + // do one argument + do + { + if (args[index] == '\\') + { + int cSlashes = 1; + index += 1; + while (index == args.Length && args[index] == '\\') + { + cSlashes += 1; + } + + if (index == args.Length || args[index] != '"') + { + currentArg.Append('\\', cSlashes); + } + else + { + currentArg.Append('\\', (cSlashes >> 1)); + if (0 != (cSlashes & 1)) + { + currentArg.Append('"'); + } + else + { + inQuotes = !inQuotes; + } + } + } + else if (args[index] == '"') + { + inQuotes = !inQuotes; + index += 1; + } + else + { + currentArg.Append(args[index]); + index += 1; + } + } while (!char.IsWhiteSpace(args[index]) || inQuotes); + argArray.Add(currentArg.ToString()); + currentArg.Length = 0; + } + } + catch (IndexOutOfRangeException) + { + // got EOF + if (inQuotes) + { + _reporter(string.Format("Error: Unbalanced '\"' in command line argument file '{0}'", fileName)); + hadError = true; + } + else if (currentArg.Length > 0) + { + // valid argument can be terminated by EOF + argArray.Add(currentArg.ToString()); + } + } + + argumentsOut = (string[]) argArray.ToArray(typeof (string)); + return hadError; + } + + private static string LongName(ArgumentAttribute attribute, FieldInfo field) + { + return (attribute == null || attribute.DefaultLongName) ? field.Name : attribute.LongName; + } + + private static void NullErrorReporter(string message) + { + } + + private int NumberOfParametersToDisplay() + { + int numberOfParameters = _arguments.Count + 1; + if (HasDefaultArgument) + { + numberOfParameters += 1; + } + return numberOfParameters; + } + + /// + /// Parses an argument list into an object + /// + /// + /// + /// true if an error occurred + private bool ParseArgumentList(IEnumerable args, object destination) + { + bool hadError = false; + if (args != null) + { + foreach (string argument in args) + { + if (argument.Length > 0) + { + switch (argument[0]) + { + case '-': + case '/': + int endIndex = argument.IndexOfAny(new[] {':', '+', '-'}, 1); + string option = argument.Substring(1, + endIndex == -1 ? argument.Length - 1 : endIndex - 1); + string optionArgument; + if (option.Length + 1 == argument.Length) + { + optionArgument = null; + } + else if (argument.Length > 1 + option.Length && argument[1 + option.Length] == ':') + { + optionArgument = argument.Substring(option.Length + 2); + } + else + { + optionArgument = argument.Substring(option.Length + 1); + } + + Argument arg = (Argument) _argumentMap[option]; + if (arg == null) + { + ReportUnrecognizedArgument(argument); + hadError = true; + } + else + { + hadError |= !arg.SetValue(optionArgument, destination); + } + break; + case '@': + string[] nestedArguments; + hadError |= LexFileArguments(argument.Substring(1), out nestedArguments); + hadError |= ParseArgumentList(nestedArguments, destination); + break; + default: + if (_defaultArgument != null) + { + hadError |= !_defaultArgument.SetValue(argument, destination); + } + else + { + ReportUnrecognizedArgument(argument); + hadError = true; + } + break; + } + } + } + } + + return hadError; + } + + private void ReportUnrecognizedArgument(string argument) + { + _reporter(string.Format("Unrecognized command line argument '{0}'", argument)); + } + + private static string ShortName(ArgumentAttribute attribute, FieldInfo field) + { + if (attribute is DefaultArgumentAttribute) + return null; + if (!ExplicitShortName(attribute)) + return LongName(attribute, field).Substring(0, 1); + return attribute.ShortName; + } + + #region Nested type: Argument + + [DebuggerDisplay("Name = {LongName}")] + private class Argument + { + private readonly ArrayList _collectionValues; + private readonly object _defaultValue; + private readonly Type _elementType; + private readonly bool _explicitShortName; + private readonly FieldInfo _field; + private readonly ArgumentType _flags; + private readonly bool _hasHelpText; + private readonly string _helpText; + private readonly bool _isDefault; + private readonly string _longName; + private readonly ErrorReporter _reporter; + private bool _seenValue; + private string _shortName; + + public Argument(ArgumentAttribute attribute, FieldInfo field, ErrorReporter reporter) + { + _longName = CommandLineParser.LongName(attribute, field); + _explicitShortName = CommandLineParser.ExplicitShortName(attribute); + _shortName = CommandLineParser.ShortName(attribute, field); + _hasHelpText = CommandLineParser.HasHelpText(attribute); + _helpText = CommandLineParser.HelpText(attribute); + _defaultValue = CommandLineParser.DefaultValue(attribute); + _elementType = ElementType(field); + _flags = Flags(attribute, field); + _field = field; + _seenValue = false; + _reporter = reporter; + _isDefault = attribute != null && attribute is DefaultArgumentAttribute; + + if (IsCollection) + { + _collectionValues = new ArrayList(); + } + + Debug.Assert(!string.IsNullOrEmpty(_longName)); + Debug.Assert(!_isDefault || !ExplicitShortName); + Debug.Assert(!IsCollection || AllowMultiple, "Collection arguments must have allow multiple"); + Debug.Assert(!Unique || IsCollection, "Unique only applicable to collection arguments"); + Debug.Assert(IsValidElementType(Type) || IsCollectionType(Type)); + Debug.Assert((IsCollection && IsValidElementType(_elementType)) || + (!IsCollection && _elementType == null)); + Debug.Assert(!(IsRequired && HasDefaultValue), "Required arguments cannot have default value"); + Debug.Assert(!HasDefaultValue || (_defaultValue.GetType() == field.FieldType), + "Type of default value must match field type"); + } + + private Type ValueType + { + get { return IsCollection ? _elementType : Type; } + } + + public string LongName + { + get { return _longName; } + } + + public bool ExplicitShortName + { + get { return _explicitShortName; } + } + + public string ShortName + { + get { return _shortName; } + } + + private bool HasShortName + { + get { return _shortName != null; } + } + + private bool HasHelpText + { + get { return _hasHelpText; } + } + + private string HelpText + { + get { return _helpText; } + } + + private object DefaultValue + { + get { return _defaultValue; } + } + + private bool HasDefaultValue + { + get { return null != _defaultValue; } + } + + public string FullHelpText + { + get + { + StringBuilder builder = new StringBuilder(); + if (HasHelpText) + { + builder.Append(HelpText); + } + if (HasDefaultValue) + { + if (builder.Length > 0) + builder.Append(" "); + builder.Append("Default value:'"); + AppendValue(builder, DefaultValue); + builder.Append('\''); + } + if (HasShortName) + { + if (builder.Length > 0) + builder.Append(" "); + builder.Append("(short form /"); + builder.Append(ShortName); + builder.Append(")"); + } + return builder.ToString(); + } + } + + public string SyntaxHelp + { + get + { + StringBuilder builder = new StringBuilder(); + + if (IsDefault) + { + builder.Append("<"); + builder.Append(LongName); + builder.Append(">"); + } + else + { + builder.Append("/"); + builder.Append(LongName); + Type valueType = ValueType; + if (valueType == typeof (int)) + { + builder.Append(":"); + } + else if (valueType == typeof (uint)) + { + builder.Append(":"); + } + else if (valueType == typeof (bool)) + { + builder.Append("[+|-]"); + } + else if (valueType == typeof (string)) + { + builder.Append(":"); + } + else + { + Debug.Assert(valueType.IsEnum); + + builder.Append(":{"); + bool first = true; + foreach (FieldInfo info in valueType.GetFields()) + { + if (info.IsStatic) + { + if (first) + first = false; + else + builder.Append('|'); + builder.Append(info.Name); + } + } + builder.Append('}'); + } + } + + return builder.ToString(); + } + } + + private bool IsRequired + { + get { return 0 != (_flags & ArgumentType.Required); } + } + + private bool SeenValue + { + get { return _seenValue; } + } + + private bool AllowMultiple + { + get { return 0 != (_flags & ArgumentType.Multiple); } + } + + private bool Unique + { + get { return 0 != (_flags & ArgumentType.Unique); } + } + + private Type Type + { + get { return _field.FieldType; } + } + + private bool IsCollection + { + get { return IsCollectionType(Type); } + } + + private bool IsDefault + { + get { return _isDefault; } + } + + public bool Finish(object destination) + { + if (SeenValue) + { + if (IsCollection) + { + _field.SetValue(destination, _collectionValues.ToArray(_elementType)); + } + } + else + { + if (HasDefaultValue) + { + _field.SetValue(destination, DefaultValue); + } + } + + return ReportMissingRequiredArgument(); + } + + private bool ReportMissingRequiredArgument() + { + if (IsRequired && !SeenValue) + { + if (IsDefault) + _reporter(string.Format("Missing required argument '<{0}>'.", LongName)); + else + _reporter(string.Format("Missing required argument '/{0}'.", LongName)); + return true; + } + return false; + } + + private void ReportDuplicateArgumentValue(string value) + { + _reporter(string.Format("Duplicate '{0}' argument '{1}'", LongName, value)); + } + + public bool SetValue(string value, object destination) + { + if (SeenValue && !AllowMultiple) + { + _reporter(string.Format("Duplicate '{0}' argument", LongName)); + return false; + } + _seenValue = true; + + object newValue; + + if (!ParseValue(ValueType, value, out newValue)) + { + return false; + } + + if (IsCollection) + { + if (Unique && _collectionValues.Contains(newValue)) + { + ReportDuplicateArgumentValue(value); + return false; + } + _collectionValues.Add(newValue); + } + else + { + _field.SetValue(destination, newValue); + } + + return true; + } + + private void ReportBadArgumentValue(string value) + { + _reporter(string.Format("'{0}' is not a valid value for the '{1}' command line option", value, LongName)); + } + + private bool ParseValue(Type type, string stringData, out object value) + { + // null is only valid for bool variables + // empty string is never valid + if (!string.IsNullOrEmpty(stringData) || type == typeof (bool)) + { + try + { + do //omed loop + { + if (type == typeof (string)) + { + value = stringData; + return true; + } + + if (type == typeof (bool)) + { + if (stringData == null || stringData == "+") + { + value = true; + return true; + } + + if (stringData == "-") + { + value = false; + return true; + } + break; + } + + // from this point on, a null or empty string is invalid + if (string.IsNullOrEmpty(stringData)) + { + break; + } + + if (type == typeof (int)) + { + value = int.Parse(stringData); + return true; + } + + if (type == typeof (uint)) + { + value = int.Parse(stringData); + return true; + } + + //SKY:12/25/09 - added ushort + if (type == typeof (ushort)) + { + value = ushort.Parse(stringData); + return true; + } + + Debug.Assert(type.IsEnum); + + bool valid = false; + + foreach (string name in Enum.GetNames(type)) + { + if (string.Compare(name, stringData, StringComparison.InvariantCultureIgnoreCase) == 0) + { + valid = true; + break; + } + } + if (valid) + { + value = Enum.Parse(type, stringData, true); + return true; + } + } while (false); + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + // catch parse errors + } + } + + ReportBadArgumentValue(stringData); + value = null; + return false; + } + + private static void AppendValue(StringBuilder builder, object value) + { + //SKY:12/25/09 - add ushort + if (value is string || value is int || value is uint || value is ushort || value.GetType().IsEnum) + { + builder.Append(value.ToString()); + } + else if (value is bool) + { + builder.Append((bool) value ? "+" : "-"); + } + else + { + bool first = true; + foreach (object o in (Array) value) + { + if (!first) + { + builder.Append(", "); + } + AppendValue(builder, o); + first = false; + } + } + } + + public void ClearShortName() + { + _shortName = null; + } + } + + #endregion + + #region Nested type: ArgumentHelpStrings + + private struct ArgumentHelpStrings + { + public readonly string help; + public readonly string syntax; + + public ArgumentHelpStrings(string syntax, string help) + { + this.syntax = syntax; + this.help = help; + } + } + + #endregion + + #region Nested type: HelpArgument + + private class HelpArgument + { + [Argument(ArgumentType.AtMostOnce, ShortName = "?")] public bool help; + } + + #endregion + } + + /// + /// A delegate used in error reporting. + /// + public delegate void ErrorReporter(string message); + + /// + /// Indicates that this argument is the default argument. + /// '/' or '-' prefix only the argument value is specified. + /// The ShortName property should not be set for DefaultArgumentAttribute + /// instances. The LongName property is used for usage text only and + /// does not affect the usage of the argument. + /// + [AttributeUsage(AttributeTargets.Field)] + public class DefaultArgumentAttribute : ArgumentAttribute + { + /// + /// Indicates that this argument is the default argument. + /// + /// Specifies the error checking to be done on the argument. + public DefaultArgumentAttribute(ArgumentType type) + : base(type) + { + } + } + + /// + /// Used to control parsing of command line arguments. + /// + [Flags] + public enum ArgumentType + { + /// + /// Indicates that this field is required. An error will be displayed + /// if it is not present when parsing arguments. + /// + Required = 0x01, + /// + /// Only valid in conjunction with Multiple. + /// Duplicate values will result in an error. + /// + Unique = 0x02, + /// + /// Inidicates that the argument may be specified more than once. + /// Only valid if the argument is a collection + /// + Multiple = 0x04, + + /// + /// The default type for non-collection arguments. + /// The argument is not required, but an error will be reported if it is specified more than once. + /// + AtMostOnce = 0x00, + + /// + /// For non-collection arguments, when the argument is specified more than + /// once no error is reported and the value of the argument is the last + /// value which occurs in the argument list. + /// + LastOccurenceWins = Multiple, + + /// + /// The default type for collection arguments. + /// The argument is permitted to occur multiple times, but duplicate + /// values will cause an error to be reported. + /// + MultipleUnique = Multiple | Unique, + } + + /// + /// Allows attaching generic help text to arguments class + /// + /// 12/29/09 sky: added + /// + [AttributeUsage(AttributeTargets.Class)] + public class ArgumentsAttribute : Attribute + { + private string _helpText; + + /// + /// Returns true if the argument has help text specified. + /// + public bool HasHelpText + { + get { return null != _helpText; } + } + + /// + /// The help text for the argument. + /// + public string HelpText + { + get { return _helpText; } + set { _helpText = value; } + } + } + + /// + /// Allows control of command line parsing. + /// Attach this attribute to instance fields of types used + /// as the destination of command line argument parsing. + /// + [AttributeUsage(AttributeTargets.Field)] + public class ArgumentAttribute : Attribute + { + #region Fields + + private readonly ArgumentType _type; + private object _defaultValue; + + private string _helpText; + + private string _longName; + + private string _shortName; + + #endregion + + #region Constructors + + /// + /// Allows control of command line parsing. + /// + /// Specifies the error checking to be done on the argument. + public ArgumentAttribute(ArgumentType type) + { + _type = type; + } + + #endregion + + #region Properties + + /// + /// Returns true if the argument did not have an explicit long name specified. + /// + public bool DefaultLongName + { + get { return null == _longName; } + } + + /// + /// Returns true if the argument did not have an explicit short name specified. + /// + public bool DefaultShortName + { + get { return null == _shortName; } + } + + /// + /// The default value of the argument. + /// + public object DefaultValue + { + get { return _defaultValue; } + set { _defaultValue = value; } + } + + /// + /// Returns true if the argument has a default value. + /// + public bool HasDefaultValue + { + get { return null != _defaultValue; } + } + + /// + /// Returns true if the argument has help text specified. + /// + public bool HasHelpText + { + get { return null != _helpText; } + } + + /// + /// The help text for the argument. + /// + public string HelpText + { + get { return _helpText; } + set { _helpText = value; } + } + + /// + /// The long name of the argument. + /// Set to null means use the default long name. + /// The long name for every argument must be unique. + /// It is an error to specify a long name of String.Empty. + /// + public string LongName + { + get + { + Debug.Assert(!DefaultLongName); + return _longName; + } + set + { + Debug.Assert(value != ""); + _longName = value; + } + } + + /// + /// The short name of the argument. + /// Set to null means use the default short name if it does not + /// conflict with any other parameter name. + /// Set to String.Empty for no short name. + /// This property should not be set for DefaultArgumentAttributes. + /// + public string ShortName + { + get { return _shortName; } + set + { + Debug.Assert(value == null || !(this is DefaultArgumentAttribute)); + _shortName = value; + } + } + + /// + /// The error checking to be done on the argument. + /// + public ArgumentType Type + { + get { return _type; } + } + + #endregion + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/Common.cs b/CassiniDev/Misc/Common.cs new file mode 100644 index 000000000..6ba35d0cf --- /dev/null +++ b/CassiniDev/Misc/Common.cs @@ -0,0 +1,1783 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using System.Web.UI; + +#endregion + +namespace CassiniDev +{ + internal static class Common + { + public static string ConvertToHexView(this byte[] value, int numBytesPerRow) + { + if (value == null) return null; + + List hexSplit = BitConverter.ToString(value) + .Replace('-', ' ') + .Trim() + .SplitIntoChunks(numBytesPerRow*3) + .ToList(); + + int byteAddress = 0; + StringBuilder sb = new StringBuilder(); + + for (int i = 0; i < hexSplit.Count; i++) + { + sb.AppendLine(byteAddress.ToString("X4") + ":\t" + hexSplit[i]); + byteAddress += numBytesPerRow; + } + + return sb.ToString(); + } + + public static string GetAspVersion() + { + string version = null; + try + { + Type type = typeof (Page); + Assembly assembly = Assembly.GetAssembly(type); + + object[] customAttributes = assembly.GetCustomAttributes(typeof (AssemblyFileVersionAttribute), true); + if ((customAttributes != null) && (customAttributes.GetLength(0) > 0)) + { + version = ((AssemblyFileVersionAttribute) customAttributes[0]).Version; + } + else + { + version = assembly.GetName().Version.ToString(); + } + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + return version; + } + + /// + /// CassiniDev FIX: #12506 + /// + /// + /// + public static string GetContentType(string fileName) + { + if (!File.Exists(fileName)) + { + return null; + } + + string contentType; + + FileInfo info = new FileInfo(fileName); + string extension = info.Extension.ToLowerInvariant(); + + switch (extension) + { + //NOTE: these are fallbacks - and should be refined as needed + // Only if the request does not already know + // the content-type will this switch be hit - meaning that + // served content-types for extensions listed here may not match + // as this method may not be polled. + + case ".svgz": + contentType = "image/svg+xml"; + break; + + // from registry - last resort - verified mappings follow + + case ".3g2": + contentType = "video/3gpp2"; + break; + case ".3gp": + contentType = "video/3gpp"; + break; + case ".3gp2": + contentType = "video/3gpp2"; + break; + case ".3gpp": + contentType = "video/3gpp"; + break; + case ".adt": + contentType = "audio/vnd.dlna.adts"; + break; + case ".amr": + contentType = "audio/AMR"; + break; + case ".addin": + contentType = "text/xml"; + break; + case ".evr": + contentType = "audio/evrc-qcp"; + break; + case ".evrc": + contentType = "audio/evrc-qcp"; + break; + case ".ssisdeploymentmanifest": + contentType = "text/xml"; + break; + case ".xoml": + contentType = "text/plain"; + break; + case ".aac": + contentType = "audio/aac"; + break; + case ".ac3": + contentType = "audio/ac3"; + break; + case ".accda": + contentType = "application/msaccess"; + break; + case ".accdb": + contentType = "application/msaccess"; + break; + case ".accdc": + contentType = "application/msaccess"; + break; + case ".accde": + contentType = "application/msaccess"; + break; + case ".accdr": + contentType = "application/msaccess"; + break; + case ".accdt": + contentType = "application/msaccess"; + break; + case ".acrobatsecuritysettings": + contentType = "application/vnd.adobe.acrobat-security-settings"; + break; + case ".ad": + contentType = "text/plain"; + break; + case ".ade": + contentType = "application/msaccess"; + break; + case ".adobebridge": + contentType = "application/x-bridge-url"; + break; + case ".adp": + contentType = "application/msaccess"; + break; + case ".adts": + contentType = "audio/vnd.dlna.adts"; + break; + case ".amc": + contentType = "application/x-mpeg"; + break; + case ".application": + contentType = "application/x-ms-application"; + break; + case ".asa": + contentType = "application/xml"; + break; + case ".asax": + contentType = "application/xml"; + break; + case ".ascx": + contentType = "application/xml"; + break; + + case ".ashx": + contentType = "application/xml"; + break; + case ".asm": + contentType = "text/plain"; + break; + case ".asmx": + contentType = "application/xml"; + break; + case ".aspx": + contentType = "application/xml"; + break; + case ".awf": + contentType = "application/vnd.adobe.workflow"; + break; + case ".biz": + contentType = "text/xml"; + break; + + case ".c2r": + contentType = "text/vnd-ms.click2record+xml"; + break; + case ".caf": + contentType = "audio/x-caf"; + break; + + case ".cc": + contentType = "text/plain"; + break; + case ".cd": + contentType = "text/plain"; + break; + case ".cdda": + contentType = "audio/aiff"; + break; + + case ".config": + contentType = "application/xml"; + break; + case ".contact": + contentType = "text/x-ms-contact"; + break; + case ".coverage": + contentType = "application/xml"; + break; + case ".cpp": + contentType = "text/plain"; + break; + case ".cs": + contentType = "text/plain"; + break; + case ".csdproj": + contentType = "text/plain"; + break; + case ".csproj": + contentType = "text/plain"; + break; + + case ".csv": + contentType = "application/vnd.ms-excel"; + break; + case ".cur": + contentType = "text/plain"; + break; + case ".cxx": + contentType = "text/plain"; + break; + case ".datasource": + contentType = "application/xml"; + break; + case ".dbproj": + contentType = "text/plain"; + break; + case ".dcd": + contentType = "text/xml"; + break; + case ".dd": + contentType = "text/plain"; + break; + case ".def": + contentType = "text/plain"; + break; + + case ".design": + contentType = "image/design"; + break; + case ".dgml": + contentType = "application/xml"; + break; + case ".dib": + contentType = "image/bmp"; + break; + case ".dif": + contentType = "video/x-dv"; + break; + case ".docm": + contentType = "application/vnd.ms-word.document.macroEnabled.12"; + break; + case ".docx": + contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; + break; + case ".dotm": + contentType = "application/vnd.ms-word.template.macroEnabled.12"; + break; + case ".dotx": + contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.template"; + break; + case ".dsp": + contentType = "text/plain"; + break; + case ".dsprototype": + contentType = "text/plain"; + break; + case ".dsw": + contentType = "text/plain"; + break; + case ".dtd": + contentType = "application/xml-dtd"; + break; + case ".dtsconfig": + contentType = "text/xml"; + break; + case ".dv": + contentType = "video/x-dv"; + break; + case ".dwfx": + contentType = "model/vnd.dwfx+xps"; + break; + case ".easmx": + contentType = "model/vnd.easmx+xps"; + break; + case ".edrwx": + contentType = "model/vnd.edrwx+xps"; + break; + case ".eprtx": + contentType = "model/vnd.eprtx+xps"; + break; + case ".fdf": + contentType = "application/vnd.fdf"; + break; + case ".filters": + contentType = "Application/xml"; + break; + case ".flc": + contentType = "video/flc"; + break; + case ".fo": + contentType = "text/xml"; + break; + case ".fsscript": + contentType = "application/fsharp-script"; + break; + case ".fsx": + contentType = "application/fsharp-script"; + break; + case ".generictest": + contentType = "application/xml"; + break; + case ".group": + contentType = "text/x-ms-group"; + break; + case ".gsm": + contentType = "audio/x-gsm"; + break; + case ".hpp": + contentType = "text/plain"; + break; + case ".hxa": + contentType = "application/xml"; + break; + case ".hxc": + contentType = "application/xml"; + break; + case ".hxd": + contentType = "application/octet-stream"; + break; + case ".hxe": + contentType = "application/xml"; + break; + case ".hxf": + contentType = "application/xml"; + break; + case ".hxh": + contentType = "application/octet-stream"; + break; + case ".hxi": + contentType = "application/octet-stream"; + break; + case ".hxk": + contentType = "application/xml"; + break; + case ".hxq": + contentType = "application/octet-stream"; + break; + case ".hxr": + contentType = "application/octet-stream"; + break; + case ".hxs": + contentType = "application/octet-stream"; + break; + case ".hxt": + contentType = "application/xml"; + break; + case ".hxv": + contentType = "application/xml"; + break; + case ".hxw": + contentType = "application/octet-stream"; + break; + case ".hxx": + contentType = "text/plain"; + break; + case ".i": + contentType = "text/plain"; + break; + case ".idl": + contentType = "text/plain"; + break; + case ".inc": + contentType = "text/plain"; + break; + case ".inl": + contentType = "text/plain"; + break; + case ".ipproj": + contentType = "text/plain"; + break; + case ".iqy": + contentType = "text/x-ms-iqy"; + break; + case ".ismv": + contentType = "video/ismv"; + break; + case ".jsx": + contentType = "text/plain"; + break; + case ".jsxbin": + contentType = "text/plain"; + break; + case ".jtx": + contentType = "application/x-jtx+xps"; + break; + case ".ldd": + contentType = "text/plain"; + break; + case ".library-ms": + contentType = "application/windows-library+xml"; + break; + case ".loadtest": + contentType = "application/xml"; + break; + case ".lsaprototype": + contentType = "text/plain"; + break; + case ".lst": + contentType = "text/plain"; + break; + case ".m1v": + contentType = "video/mpeg"; + break; + case ".m2t": + contentType = "video/vnd.dlna.mpeg-tts"; + break; + case ".m2ts": + contentType = "video/vnd.dlna.mpeg-tts"; + break; + case ".m2v": + contentType = "video/mpeg"; + break; + case ".m4a": + contentType = "audio/mp4"; + break; + case ".m4b": + contentType = "audio/x-m4b"; + break; + case ".m4p": + contentType = "audio/x-m4p"; + break; + case ".m4v": + contentType = "video/x-m4v"; + break; + case ".mac": + contentType = "image/x-macpaint"; + break; + case ".mak": + contentType = "text/plain"; + break; + case ".map": + contentType = "text/plain"; + break; + case ".master": + contentType = "application/xml"; + break; + case ".mda": + contentType = "application/msaccess"; + break; + case ".mde": + contentType = "application/msaccess"; + break; + case ".mdp": + contentType = "text/plain"; + break; + case ".mfp": + contentType = "application/x-shockwave-flash"; + break; + case ".mk": + contentType = "text/plain"; + break; + case ".mod": + contentType = "video/mpeg"; + break; + case ".mp2v": + contentType = "video/mpeg"; + break; + case ".mp4": + contentType = "video/mp4"; + break; + case ".mp4v": + contentType = "video/mp4"; + break; + case ".mpf": + contentType = "application/vnd.ms-mediapackage"; + break; + case ".mqv": + contentType = "video/quicktime"; + break; + case ".mts": + contentType = "video/vnd.dlna.mpeg-tts"; + break; + case ".mtx": + contentType = "application/xml"; + break; + case ".mxp": + contentType = "application/x-mmxp"; + break; + case ".nix": + contentType = "application/x-mix-transfer"; + break; + case ".odc": + contentType = "text/x-ms-odc"; + break; + case ".odh": + contentType = "text/plain"; + break; + case ".odl": + contentType = "text/plain"; + break; + case ".odp": + contentType = "application/vnd.oasis.opendocument.presentation"; + break; + case ".ods": + contentType = "application/vnd.oasis.opendocument.spreadsheet"; + break; + case ".odt": + contentType = "application/vnd.oasis.opendocument.text"; + break; + case ".orderedtest": + contentType = "application/xml"; + break; + case ".osdx": + contentType = "application/opensearchdescription+xml"; + break; + case ".pct": + contentType = "image/pict"; + break; + case ".pcx": + contentType = "image/x-pcx"; + break; + + case ".pdfxml": + contentType = "application/vnd.adobe.pdfxml"; + break; + case ".pdx": + contentType = "application/vnd.adobe.pdx"; + break; + case ".pic": + contentType = "image/pict"; + break; + case ".pict": + contentType = "image/pict"; + break; + case ".pkgdef": + contentType = "text/plain"; + break; + case ".pkgundef": + contentType = "text/plain"; + break; + case ".png": + contentType = "image/png"; + break; + case ".pnt": + contentType = "image/x-macpaint"; + break; + case ".pntg": + contentType = "image/x-macpaint"; + break; + case ".potm": + contentType = "application/vnd.ms-powerpoint.template.macroEnabled.12"; + break; + case ".potx": + contentType = "application/vnd.openxmlformats-officedocument.presentationml.template"; + break; + case ".ppa": + contentType = "application/vnd.ms-powerpoint"; + break; + case ".ppam": + contentType = "application/vnd.ms-powerpoint.addin.macroEnabled.12"; + break; + case ".ppsm": + contentType = "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"; + break; + case ".ppsx": + contentType = "application/vnd.openxmlformats-officedocument.presentationml.slideshow"; + break; + case ".pptm": + contentType = "application/vnd.ms-powerpoint.presentation.macroEnabled.12"; + break; + case ".pptx": + contentType = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; + break; + case ".psc1": + contentType = "application/PowerShell"; + break; + case ".psess": + contentType = "application/xml"; + break; + case ".pwz": + contentType = "application/vnd.ms-powerpoint"; + break; + case ".pxr": + contentType = "image/pxr"; + break; + case ".qcp": + contentType = "audio/vnd.qcelp"; + break; + case ".qht": + contentType = "text/x-html-insertion"; + break; + case ".qhtm": + contentType = "text/x-html-insertion"; + break; + case ".qti": + contentType = "image/x-quicktime"; + break; + case ".qtif": + contentType = "image/x-quicktime"; + break; + case ".qtl": + contentType = "application/x-quicktimeplayer"; + break; + case ".rat": + contentType = "application/rat-file"; + break; + case ".raw": + contentType = "application/octet-stream"; + break; + + case ".rc": + contentType = "text/plain"; + break; + case ".rc2": + contentType = "text/plain"; + break; + case ".rct": + contentType = "text/plain"; + break; + case ".rdf": + contentType = "text/xml"; + break; + case ".rdlc": + contentType = "application/xml"; + break; + case ".rels": + contentType = "application/vnd.ms-package.relationships+xml"; + break; + case ".resx": + contentType = "application/xml"; + break; + case ".rgs": + contentType = "text/plain"; + break; + case ".rjt": + contentType = "application/vnd.rn-realsystem-rjt"; + break; + case ".rm": + contentType = "application/vnd.rn-realmedia"; + break; + case ".rmf": + contentType = "application/vnd.adobe.rmf"; + break; + case ".rmj": + contentType = "application/vnd.rn-realsystem-rmj"; + break; + case ".rmm": + contentType = "audio/x-pn-realaudio"; + break; + case ".rmp": + contentType = "application/vnd.rn-rn_music_package"; + break; + case ".rms": + contentType = "application/vnd.rn-realaudio-secure"; + break; + case ".rmvb": + contentType = "application/vnd.rn-realmedia-vbr"; + break; + case ".rmx": + contentType = "application/vnd.rn-realsystem-rmx"; + break; + case ".rnx": + contentType = "application/vnd.rn-realplayer"; + break; + case ".rp": + contentType = "image/vnd.rn-realpix"; + break; + case ".rpm": + contentType = "audio/x-pn-realaudio-plugin"; + break; + case ".rqy": + contentType = "text/x-ms-rqy"; + break; + case ".rsml": + contentType = "application/vnd.rn-rsml"; + break; + case ".rt": + contentType = "text/vnd.rn-realtext"; + break; + case ".rtsp": + contentType = "application/x-rtsp"; + break; + case ".ruleset": + contentType = "application/xml"; + break; + case ".rv": + contentType = "video/vnd.rn-realvideo"; + break; + case ".s": + contentType = "text/plain"; + break; + case ".sd": + contentType = "text/plain"; + break; + case ".sd2": + contentType = "audio/x-sd2"; + break; + case ".sdm": + contentType = "text/plain"; + break; + case ".sdmdocument": + contentType = "text/plain"; + break; + case ".sdp": + contentType = "application/sdp"; + break; + case ".sdv": + contentType = "video/sd-video"; + break; + case ".searchConnector-ms": + contentType = "application/windows-search-connector+xml"; + break; + case ".settings": + contentType = "application/xml"; + break; + case ".sgi": + contentType = "image/x-sgi"; + break; + case ".shtml": + contentType = "text/html"; + break; + case ".sitemap": + contentType = "application/xml"; + break; + case ".skin": + contentType = "application/xml"; + break; + case ".sldm": + contentType = "application/vnd.ms-powerpoint.slide.macroEnabled.12"; + break; + case ".sldx": + contentType = "application/vnd.openxmlformats-officedocument.presentationml.slide"; + break; + case ".slk": + contentType = "application/vnd.ms-excel"; + break; + case ".sln": + contentType = "text/plain"; + break; + case ".slupkg-ms": + contentType = "application/x-ms-license"; + break; + case ".smi": + contentType = "application/smil"; + break; + case ".smil": + contentType = "application/smil"; + break; + case ".snippet": + contentType = "application/xml"; + break; + case ".sol": + contentType = "text/plain"; + break; + case ".sor": + contentType = "text/plain"; + break; + case ".srf": + contentType = "text/plain"; + break; + case ".svc": + contentType = "application/xml"; + break; + case ".tga": + contentType = "image/x-targa"; + break; + case ".targa": + contentType = "image/x-targa"; + break; + case ".testrunconfig": + contentType = "application/xml"; + break; + case ".testsettings": + contentType = "application/xml"; + break; + case ".thmx": + contentType = "application/vnd.ms-officetheme"; + break; + case ".tlh": + contentType = "text/plain"; + break; + case ".tli": + contentType = "text/plain"; + break; + case ".trx": + contentType = "application/xml"; + break; + case ".ts": + contentType = "video/vnd.dlna.mpeg-tts"; + break; + case ".tts": + contentType = "video/vnd.dlna.mpeg-tts"; + break; + case ".user": + contentType = "text/plain"; + break; + case ".vb": + contentType = "text/plain"; + break; + case ".vbdproj": + contentType = "text/plain"; + break; + case ".vbproj": + contentType = "text/plain"; + break; + case ".vcproj": + contentType = "Application/xml"; + break; + case ".vcxproj": + contentType = "Application/xml"; + break; + case ".vddproj": + contentType = "text/plain"; + break; + case ".vdp": + contentType = "text/plain"; + break; + case ".vdproj": + contentType = "text/plain"; + break; + case ".vdx": + contentType = "application/vnd.visio"; + break; + case ".vscontent": + contentType = "application/xml"; + break; + case ".vsct": + contentType = "text/xml"; + break; + case ".vsd": + contentType = "application/vnd.visio"; + break; + case ".vsi": + contentType = "application/ms-vsi"; + break; + case ".vsix": + contentType = "application/vsix"; + break; + case ".vsixlangpack": + contentType = "text/xml"; + break; + case ".vsixmanifest": + contentType = "text/xml"; + break; + case ".vsl": + contentType = "application/vnd.visio"; + break; + case ".vsmdi": + contentType = "application/xml"; + break; + case ".vspscc": + contentType = "text/plain"; + break; + case ".vss": + contentType = "application/vnd.visio"; + break; + case ".vsscc": + contentType = "text/plain"; + break; + case ".vssettings": + contentType = "text/xml"; + break; + case ".vssscc": + contentType = "text/plain"; + break; + case ".vst": + contentType = "application/vnd.visio"; + break; + case ".vstemplate": + contentType = "text/xml"; + break; + case ".vsto": + contentType = "application/x-ms-vsto"; + break; + case ".vsu": + contentType = "application/vnd.visio"; + break; + case ".vsw": + contentType = "application/vnd.visio"; + break; + case ".vsx": + contentType = "application/vnd.visio"; + break; + case ".vtx": + contentType = "application/vnd.visio"; + break; + case ".wax": + contentType = "audio/x-ms-wax"; + break; + case ".wbk": + contentType = "application/msword"; + break; + case ".wdp": + contentType = "image/vnd.ms-photo"; + break; + case ".webtest": + contentType = "application/xml"; + break; + case ".wiq": + contentType = "application/xml"; + break; + case ".wiz": + contentType = "application/msword"; + break; + case ".wm": + contentType = "video/x-ms-wm"; + break; + case ".wma": + contentType = "audio/x-ms-wma"; + break; + case ".wmd": + contentType = "application/x-ms-wmd"; + break; + case ".wmv": + contentType = "video/x-ms-wmv"; + break; + case ".wmx": + contentType = "video/x-ms-wmx"; + break; + case ".wmz": + contentType = "application/x-ms-wmz"; + break; + case ".wpl": + contentType = "application/vnd.ms-wpl"; + break; + case ".wsc": + contentType = "text/scriptlet"; + break; + case ".wsdl": + contentType = "application/xml"; + break; + case ".wvx": + contentType = "video/x-ms-wvx"; + break; + case ".xaml": + contentType = "application/xaml+xml"; + break; + case ".xbap": + contentType = "application/x-ms-xbap"; + break; + case ".xbrl": + contentType = "text/xml"; + break; + case ".xdp": + contentType = "application/vnd.adobe.xdp+xml"; + break; + case ".xdr": + contentType = "application/xml"; + break; + case ".xej": + contentType = "application/xej+xml"; + break; + case ".xel": + contentType = "application/xel+xml"; + break; + case ".xesc": + contentType = "application/x-ms-wmv"; + break; + case ".xfd": + contentType = "application/vnd.adobe.xfd+xml"; + break; + case ".xfdf": + contentType = "application/vnd.adobe.xfdf"; + break; + case ".xht": + contentType = "application/xhtml+xml"; + break; + case ".xhtml": + contentType = "application/xhtml+xml"; + break; + case ".xlam": + contentType = "application/vnd.ms-excel.addin.macroEnabled.12"; + break; + case ".xlk": + contentType = "application/vnd.ms-excel"; + break; + case ".xll": + contentType = "application/vnd.ms-excel"; + break; + case ".xlsb": + contentType = "application/vnd.ms-excel.sheet.binary.macroEnabled.12"; + break; + case ".xlsm": + contentType = "application/vnd.ms-excel.sheet.macroEnabled.12"; + break; + case ".xlsx": + contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + break; + case ".xltm": + contentType = "application/vnd.ms-excel.template.macroEnabled.12"; + break; + case ".xltx": + contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.template"; + break; + case ".xml": + contentType = "application/xml"; + break; + case ".xmta": + contentType = "application/xml"; + break; + case ".xpr": + contentType = "image/xpr"; + break; + case ".xps": + contentType = "application/vnd.ms-xpsdocument"; + break; + case ".xrm-ms": + contentType = "text/xml"; + break; + case ".xsc": + contentType = "application/xml"; + break; + case ".xsd": + contentType = "application/xml"; + break; + case ".xsl": + contentType = "text/xml"; + break; + case ".xslt": + contentType = "application/xml"; + break; + case ".xss": + contentType = "application/xml"; + break; + + // standard mappings from http://www.w3schools.com/media/media_mimeref.asp + + case ".323": + contentType = "text/h323"; + break; + case ".acx": + contentType = "application/internet-property-stream"; + break; + case ".ai": + contentType = "application/postscript"; + break; + case ".aif": + contentType = "audio/x-aiff"; + break; + case ".aifc": + contentType = "audio/x-aiff"; + break; + case ".aiff": + contentType = "audio/x-aiff"; + break; + case ".asf": + contentType = "video/x-ms-asf"; + break; + case ".asr": + contentType = "video/x-ms-asf"; + break; + case ".asx": + contentType = "video/x-ms-asf"; + break; + case ".au": + contentType = "audio/basic"; + break; + case ".avi": + contentType = "video/x-msvideo"; + break; + case ".axs": + contentType = "application/olescript"; + break; + case ".bas": + contentType = "text/plain"; + break; + case ".bcpio": + contentType = "application/x-bcpio"; + break; + case ".bin": + contentType = "application/octet-stream"; + break; + case ".bmp": + contentType = "image/bmp"; + break; + case ".c": + contentType = "text/plain"; + break; + case ".cat": + contentType = "application/vnd.ms-pkiseccat"; + break; + case ".cdf": + contentType = "application/x-cdf"; + break; + case ".cer": + contentType = "application/x-x509-ca-cert"; + break; + case ".class": + contentType = "application/octet-stream"; + break; + case ".clp": + contentType = "application/x-msclip"; + break; + case ".cmx": + contentType = "image/x-cmx"; + break; + case ".cod": + contentType = "image/cis-cod"; + break; + case ".cpio": + contentType = "application/x-cpio"; + break; + case ".crd": + contentType = "application/x-mscardfile"; + break; + case ".crl": + contentType = "application/pkix-crl"; + break; + case ".crt": + contentType = "application/x-x509-ca-cert"; + break; + case ".csh": + contentType = "application/x-csh"; + break; + case ".css": + contentType = "text/css"; + break; + case ".dcr": + contentType = "application/x-director"; + break; + case ".der": + contentType = "application/x-x509-ca-cert"; + break; + case ".dir": + contentType = "application/x-director"; + break; + case ".dll": + contentType = "application/x-msdownload"; + break; + case ".dms": + contentType = "application/octet-stream"; + break; + case ".doc": + contentType = "application/msword"; + break; + case ".dot": + contentType = "application/msword"; + break; + case ".dvi": + contentType = "application/x-dvi"; + break; + case ".dxr": + contentType = "application/x-director"; + break; + case ".eps": + contentType = "application/postscript"; + break; + case ".etx": + contentType = "text/x-setext"; + break; + case ".evy": + contentType = "application/envoy"; + break; + case ".exe": + contentType = "application/octet-stream"; + break; + case ".fif": + contentType = "application/fractals"; + break; + case ".flr": + contentType = "x-world/x-vrml"; + break; + case ".gif": + contentType = "image/gif"; + break; + case ".gtar": + contentType = "application/x-gtar"; + break; + case ".gz": + contentType = "application/x-gzip"; + break; + case ".h": + contentType = "text/plain"; + break; + case ".hdf": + contentType = "application/x-hdf"; + break; + case ".hlp": + contentType = "application/winhlp"; + break; + case ".hqx": + contentType = "application/mac-binhex40"; + break; + case ".hta": + contentType = "application/hta"; + break; + case ".htc": + contentType = "text/x-component"; + break; + case ".htm": + contentType = "text/html"; + break; + case ".html": + contentType = "text/html"; + break; + case ".htt": + contentType = "text/webviewhtml"; + break; + case ".ico": + contentType = "image/x-icon"; + break; + case ".ief": + contentType = "image/ief"; + break; + case ".iii": + contentType = "application/x-iphone"; + break; + case ".ins": + contentType = "application/x-internet-signup"; + break; + case ".isp": + contentType = "application/x-internet-signup"; + break; + case ".jfif": + contentType = "image/pipeg"; + break; + case ".jpe": + contentType = "image/jpeg"; + break; + case ".jpeg": + contentType = "image/jpeg"; + break; + case ".jpg": + contentType = "image/jpeg"; + break; + case ".js": + contentType = "application/x-javascript"; + break; + case ".latex": + contentType = "application/x-latex"; + break; + case ".lha": + contentType = "application/octet-stream"; + break; + case ".lsf": + contentType = "video/x-la-asf"; + break; + case ".lsx": + contentType = "video/x-la-asf"; + break; + case ".lzh": + contentType = "application/octet-stream"; + break; + case ".m13": + contentType = "application/x-msmediaview"; + break; + case ".m14": + contentType = "application/x-msmediaview"; + break; + case ".m3u": + contentType = "audio/x-mpegurl"; + break; + case ".man": + contentType = "application/x-troff-man"; + break; + case ".mdb": + contentType = "application/x-msaccess"; + break; + case ".me": + contentType = "application/x-troff-me"; + break; + case ".mht": + contentType = "message/rfc822"; + break; + case ".mhtml": + contentType = "message/rfc822"; + break; + case ".mid": + contentType = "audio/mid"; + break; + case ".mny": + contentType = "application/x-msmoney"; + break; + case ".mov": + contentType = "video/quicktime"; + break; + case ".movie": + contentType = "video/x-sgi-movie"; + break; + case ".mp2": + contentType = "video/mpeg"; + break; + case ".mp3": + contentType = "audio/mpeg"; + break; + case ".mpa": + contentType = "video/mpeg"; + break; + case ".mpe": + contentType = "video/mpeg"; + break; + case ".mpeg": + contentType = "video/mpeg"; + break; + case ".mpg": + contentType = "video/mpeg"; + break; + case ".mpp": + contentType = "application/vnd.ms-project"; + break; + case ".mpv2": + contentType = "video/mpeg"; + break; + case ".ms": + contentType = "application/x-troff-ms"; + break; + case ".msg": + contentType = "application/vnd.ms-outlook"; + break; + case ".mvb": + contentType = "application/x-msmediaview"; + break; + case ".nc": + contentType = "application/x-netcdf"; + break; + case ".nws": + contentType = "message/rfc822"; + break; + case ".oda": + contentType = "application/oda"; + break; + case ".p10": + contentType = "application/pkcs10"; + break; + case ".p12": + contentType = "application/x-pkcs12"; + break; + case ".p7b": + contentType = "application/x-pkcs7-certificates"; + break; + case ".p7c": + contentType = "application/x-pkcs7-mime"; + break; + case ".p7m": + contentType = "application/x-pkcs7-mime"; + break; + case ".p7r": + contentType = "application/x-pkcs7-certreqresp"; + break; + case ".p7s": + contentType = "application/x-pkcs7-signature"; + break; + case ".pbm": + contentType = "image/x-portable-bitmap"; + break; + case ".pdf": + contentType = "application/pdf"; + break; + case ".pfx": + contentType = "application/x-pkcs12"; + break; + case ".pgm": + contentType = "image/x-portable-graymap"; + break; + case ".pko": + contentType = "application/ynd.ms-pkipko"; + break; + case ".pma": + contentType = "application/x-perfmon"; + break; + case ".pmc": + contentType = "application/x-perfmon"; + break; + case ".pml": + contentType = "application/x-perfmon"; + break; + case ".pmr": + contentType = "application/x-perfmon"; + break; + case ".pmw": + contentType = "application/x-perfmon"; + break; + case ".pnm": + contentType = "image/x-portable-anymap"; + break; + case ".pot": + contentType = "application/vnd.ms-powerpoint"; + break; + case ".pot,": + contentType = "application/vnd.ms-powerpoint"; + break; + case ".ppm": + contentType = "image/x-portable-pixmap"; + break; + case ".pps": + contentType = "application/vnd.ms-powerpoint"; + break; + case ".ppt": + contentType = "application/vnd.ms-powerpoint"; + break; + case ".prf": + contentType = "application/pics-rules"; + break; + case ".ps": + contentType = "application/postscript"; + break; + case ".pub": + contentType = "application/x-mspublisher"; + break; + case ".qt": + contentType = "video/quicktime"; + break; + case ".ra": + contentType = "audio/x-pn-realaudio"; + break; + case ".ram": + contentType = "audio/x-pn-realaudio"; + break; + case ".ras": + contentType = "image/x-cmu-raster"; + break; + case ".rgb": + contentType = "image/x-rgb"; + break; + case ".rmi": + contentType = "audio/mid"; + break; + case ".roff": + contentType = "application/x-troff"; + break; + case ".rtf": + contentType = "application/rtf"; + break; + case ".rtx": + contentType = "text/richtext"; + break; + case ".scd": + contentType = "application/x-msschedule"; + break; + case ".sct": + contentType = "text/scriptlet"; + break; + case ".setpay": + contentType = "application/set-payment-initiation"; + break; + case ".setreg": + contentType = "application/set-registration-initiation"; + break; + case ".sh": + contentType = "application/x-sh"; + break; + case ".shar": + contentType = "application/x-shar"; + break; + case ".sit": + contentType = "application/x-stuffit"; + break; + case ".snd": + contentType = "audio/basic"; + break; + case ".spc": + contentType = "application/x-pkcs7-certificates"; + break; + case ".spl": + contentType = "application/futuresplash"; + break; + case ".src": + contentType = "application/x-wais-source"; + break; + case ".sst": + contentType = "application/vnd.ms-pkicertstore"; + break; + case ".stl": + contentType = "application/vnd.ms-pkistl"; + break; + case ".stm": + contentType = "text/html"; + break; + case ".sv4cpio": + contentType = "application/x-sv4cpio"; + break; + case ".sv4crc": + contentType = "application/x-sv4crc"; + break; + case ".svg": + contentType = "image/svg+xml"; + break; + case ".swf": + contentType = "application/x-shockwave-flash"; + break; + case ".t": + contentType = "application/x-troff"; + break; + case ".tar": + contentType = "application/x-tar"; + break; + case ".tcl": + contentType = "application/x-tcl"; + break; + case ".tex": + contentType = "application/x-tex"; + break; + case ".texi": + contentType = "application/x-texinfo"; + break; + case ".texinfo": + contentType = "application/x-texinfo"; + break; + case ".tgz": + contentType = "application/x-compressed"; + break; + case ".tif": + contentType = "image/tiff"; + break; + case ".tiff": + contentType = "image/tiff"; + break; + case ".tr": + contentType = "application/x-troff"; + break; + case ".trm": + contentType = "application/x-msterminal"; + break; + case ".tsv": + contentType = "text/tab-separated-values"; + break; + case ".txt": + contentType = "text/plain"; + break; + case ".uls": + contentType = "text/iuls"; + break; + case ".ustar": + contentType = "application/x-ustar"; + break; + case ".vcf": + contentType = "text/x-vcard"; + break; + case ".vrml": + contentType = "x-world/x-vrml"; + break; + case ".wav": + contentType = "audio/x-wav"; + break; + case ".wcm": + contentType = "application/vnd.ms-works"; + break; + case ".wdb": + contentType = "application/vnd.ms-works"; + break; + case ".wks": + contentType = "application/vnd.ms-works"; + break; + case ".wmf": + contentType = "application/x-msmetafile"; + break; + case ".wps": + contentType = "application/vnd.ms-works"; + break; + case ".wri": + contentType = "application/x-mswrite"; + break; + case ".wrl": + contentType = "x-world/x-vrml"; + break; + case ".wrz": + contentType = "x-world/x-vrml"; + break; + case ".xaf": + contentType = "x-world/x-vrml"; + break; + case ".xbm": + contentType = "image/x-xbitmap"; + break; + case ".xla": + contentType = "application/vnd.ms-excel"; + break; + case ".xlc": + contentType = "application/vnd.ms-excel"; + break; + case ".xlm": + contentType = "application/vnd.ms-excel"; + break; + case ".xls": + contentType = "application/vnd.ms-excel"; + break; + case ".xlt": + contentType = "application/vnd.ms-excel"; + break; + case ".xlw": + contentType = "application/vnd.ms-excel"; + break; + case ".xof": + contentType = "x-world/x-vrml"; + break; + case ".xpm": + contentType = "image/x-xpixmap"; + break; + case ".xwd": + contentType = "image/x-xwindowdump"; + break; + case ".z": + contentType = "application/x-compress"; + break; + case ".zip": + contentType = "application/zip"; + break; + + default: + // this should be used as a last resort only. i.e. svg files return text/xml + contentType = GetMimeFromFile(fileName); + break; + } + return contentType; + } + + public static T GetValueOrDefault(this IDataRecord row, string fieldName) + { + int ordinal = row.GetOrdinal(fieldName); + return row.GetValueOrDefault(ordinal); + } + + public static T GetValueOrDefault(this IDataRecord row, int ordinal) + { + return (T) (row.IsDBNull(ordinal) ? default(T) : row.GetValue(ordinal)); + } + + public static byte[] StreamToBytes(this Stream input) + { + int capacity = input.CanSeek ? (int) input.Length : 0; + using (MemoryStream output = new MemoryStream(capacity)) + { + int readLength; + byte[] buffer = new byte[4096]; + + do + { + readLength = input.Read(buffer, 0, buffer.Length); + output.Write(buffer, 0, readLength); + } while (readLength != 0); + + return output.ToArray(); + } + } + + /// + /// CassiniDev FIX: #12506 + /// + /// + /// + private static string GetMimeFromFile(string file) + { + IntPtr mimeout; + if (!File.Exists(file)) + return null; + //throw new FileNotFoundException(file + " not found"); + + int maxContent = (int) new FileInfo(file).Length; + if (maxContent > 4096) maxContent = 4096; + FileStream fs = File.OpenRead(file); + + byte[] buf = new byte[maxContent]; + fs.Read(buf, 0, maxContent); + fs.Close(); + int result = Interop.FindMimeFromData(IntPtr.Zero, file, buf, maxContent, null, 0, out mimeout, 0); + + if (result != 0) + throw Marshal.GetExceptionForHR(result); + string mime = Marshal.PtrToStringUni(mimeout); + Marshal.FreeCoTaskMem(mimeout); + return mime; + } + + private static IList SplitIntoChunks(this string text, int chunkSize) + { + List chunks = new List(); + int offset = 0; + while (offset < text.Length) + { + int size = Math.Min(chunkSize, text.Length - offset); + chunks.Add(text.Substring(offset, size)); + offset += size; + } + return chunks; + } + } + + public enum RunState + { + Idle = 0, + Running + } + + public enum PortMode + { + FirstAvailable = 0, + Specific + } + + public enum ErrorField + { + None, + ApplicationPath, + VirtualPath, + HostName, + IsAddHost, + IPAddress, + IPAddressAny, + IPAddressLoopBack, + Port, + PortRangeStart, + PortRangeEnd, + PortRange + } + + public enum IPMode + { + Loopback = 0, + Any, + Specific + } + + public enum RunMode + { + Server, + Hostsfile + } + + internal class CassiniException : Exception + { + public CassiniException(string message, ErrorField field, Exception innerException) + : base(message, innerException) + { + Field = field; + } + + public CassiniException(string message, ErrorField field) + : this(message, field, null) + { + } + + public ErrorField Field { get; set; } + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/HostsFile.cs b/CassiniDev/Misc/HostsFile.cs new file mode 100644 index 000000000..b8a828b7f --- /dev/null +++ b/CassiniDev/Misc/HostsFile.cs @@ -0,0 +1,118 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Text.RegularExpressions; + +#endregion + +namespace CassiniDev +{ + public static class HostsFile + { + /// + /// + /// + /// + /// + /// + public static int AddHostEntry(string ipAddress, string hostname) + { + try + { + SetHostsEntry(true, ipAddress, hostname); + return 0; + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + string executablePath = Assembly.GetExecutingAssembly().Location; + return StartElevated(executablePath, string.Format("Hostsfile /ah+ /h:{0} /i:{1}", hostname, ipAddress)); + } + + /// + /// + /// + /// + /// + /// + public static int RemoveHostEntry(string ipAddress, string hostname) + { + try + { + SetHostsEntry(false, ipAddress, hostname); + return 0; + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + string executablePath = Assembly.GetExecutingAssembly().Location; + return StartElevated(executablePath, string.Format("Hostsfile /ah- /h:{0} /i:{1}", hostname, ipAddress)); + } + + private static void SetHostsEntry(bool addHost, string ipAddress, string hostname) + { + // limitation: while windows allows mulitple entries for a single host, we currently allow only one + string windir = Environment.GetEnvironmentVariable("SystemRoot") ?? @"c:\windows"; + string hostsFilePath = Path.Combine(windir, @"system32\drivers\etc\hosts"); + + string hostsFileContent = File.ReadAllText(hostsFilePath); + + hostsFileContent = Regex.Replace(hostsFileContent, + string.Format(@"\r\n^\s*[\d\w\.:]+\s{0}\s#\sadded\sby\scassini$", + hostname), "", RegexOptions.Multiline); + + if (addHost) + { + hostsFileContent += string.Format("\r\n{0} {1} # added by cassini", ipAddress, hostname); + } + + File.WriteAllText(hostsFilePath, hostsFileContent); + } + + private static int StartElevated(string filename, string args) + { + ProcessStartInfo startInfo = new ProcessStartInfo + { + UseShellExecute = true, + WorkingDirectory = Environment.CurrentDirectory, + FileName = filename, + Arguments = args, + Verb = "runas" + }; + try + { + Process p = Process.Start(startInfo); + if (p != null) + { + p.WaitForExit(); + return p.ExitCode; + } + return -2; + } + catch + { + return -2; + } + } + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/Interop.cs b/CassiniDev/Misc/Interop.cs new file mode 100644 index 000000000..4c118f2d3 --- /dev/null +++ b/CassiniDev/Misc/Interop.cs @@ -0,0 +1,160 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Runtime.InteropServices; + +#endregion + +namespace CassiniDev +{ + internal static class Interop + { + #region Structs + + [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] + public static extern int AcceptSecurityContext(ref SecHandle phCredential, IntPtr phContext, + ref SecBufferDesc pInput, uint fContextReq, uint TargetDataRep, + ref SecHandle phNewContext, ref SecBufferDesc pOutput, + ref uint pfContextAttr, ref long ptsTimeStamp); + + [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] + public static extern int AcquireCredentialsHandle(string pszPrincipal, string pszPackage, uint fCredentialUse, + IntPtr pvLogonID, IntPtr pAuthData, IntPtr pGetKeyFn, + IntPtr pvGetKeyArgument, ref SecHandle phCredential, + ref long ptsExpiry); + + [DllImport("KERNEL32.DLL", CharSet = CharSet.Unicode)] + public static extern int CloseHandle(IntPtr phToken); + + [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] + public static extern int DeleteSecurityContext(ref SecHandle phContext); + + /// + /// FIX: #12506 + /// + [DllImport("urlmon.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false)] + public static extern int FindMimeFromData(IntPtr pBC, [MarshalAs(UnmanagedType.LPWStr)] string pwzUrl, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.I1, + SizeParamIndex = 3)] byte[] pBuffer, int cbSize, + [MarshalAs(UnmanagedType.LPWStr)] string pwzMimeProposed, + int dwMimeFlags, out IntPtr ppwzMimeOut, int dwReserved); + + [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] + public static extern int FreeCredentialsHandle(ref SecHandle phCredential); + + [DllImport("kernel32.dll", EntryPoint = "GetConsoleScreenBufferInfo", SetLastError = true, + CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] + public static extern int GetConsoleScreenBufferInfo(int hConsoleOutput, + ref CONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo); + + [DllImport("KERNEL32.DLL", SetLastError = true)] + public static extern IntPtr GetCurrentThread(); + + [DllImport("kernel32.dll", EntryPoint = "GetStdHandle", SetLastError = true, CharSet = CharSet.Auto, + CallingConvention = CallingConvention.StdCall)] + public static extern int GetStdHandle(int nStdHandle); + + [DllImport("ADVAPI32.DLL", SetLastError = true)] + public static extern bool ImpersonateSelf(int level); + + [DllImport("ADVAPI32.DLL", SetLastError = true)] + public static extern int OpenThreadToken(IntPtr thread, int access, bool openAsSelf, ref IntPtr hToken); + + [DllImport("SECUR32.DLL", CharSet = CharSet.Unicode)] + public static extern int QuerySecurityContextToken(ref SecHandle phContext, ref IntPtr phToken); + + [DllImport("ADVAPI32.DLL", SetLastError = true)] + public static extern int RevertToSelf(); + + #region Nested type: CONSOLE_SCREEN_BUFFER_INFO + + public struct CONSOLE_SCREEN_BUFFER_INFO + { + internal COORD dwCursorPosition; + internal COORD dwMaximumWindowSize; + internal COORD dwSize; + internal SMALL_RECT srWindow; + internal Int16 wAttributes; + } + + #endregion + + #region Nested type: COORD + + public struct COORD + { + internal Int16 x; + internal Int16 y; + } + + #endregion + + #region Nested type: SecBuffer + + [StructLayout(LayoutKind.Sequential)] + public struct SecBuffer + { + // ReSharper disable InconsistentNaming + public uint cbBuffer; + public uint BufferType; + public IntPtr pvBuffer; + // ReSharper restore InconsistentNaming + } + + #endregion + + #region Nested type: SecBufferDesc + + [StructLayout(LayoutKind.Sequential)] + public struct SecBufferDesc + { + // ReSharper disable InconsistentNaming + public uint ulVersion; + public uint cBuffers; + public IntPtr pBuffers; + // ReSharper restore InconsistentNaming + } + + #endregion + + #region Nested type: SecHandle + + [StructLayout(LayoutKind.Sequential)] + public struct SecHandle + { + // ReSharper disable InconsistentNaming + public IntPtr dwLower; + public IntPtr dwUpper; + // ReSharper restore InconsistentNaming + } + + #endregion + + #region Nested type: SMALL_RECT + + public struct SMALL_RECT + { + internal Int16 Bottom; + internal Int16 Left; + internal Int16 Right; + internal Int16 Top; + } + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/NetworkUtils.cs b/CassiniDev/Misc/NetworkUtils.cs new file mode 100644 index 000000000..dc647d48a --- /dev/null +++ b/CassiniDev/Misc/NetworkUtils.cs @@ -0,0 +1,221 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) 2010 Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.txt file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.NetworkInformation; +using System.Text.RegularExpressions; +using System.Threading; + +#endregion + +namespace CassiniDev +{ + public static class CassiniNetworkUtils + { + public static IPAddress[] GetLocalAddresses() + { + string strHostName = Dns.GetHostName(); + IPHostEntry ipEntry = Dns.GetHostEntry(strHostName); + return ipEntry.AddressList; + } + + /// + /// Returns first available port on the specified IP address. + /// The port scan excludes ports that are open on ANY loopback adapter. + /// + /// If the address upon which a port is requested is an 'ANY' address all + /// ports that are open on ANY IP are excluded. + /// + /// + /// + /// The IP address upon which to search for available port. + /// If true includes ports in TIME_WAIT state in results. + /// TIME_WAIT state is typically cool down period for recently released ports. + /// + public static int GetAvailablePort(int rangeStart, int rangeEnd, IPAddress ip, bool includeIdlePorts) + { + IPGlobalProperties ipProps = IPGlobalProperties.GetIPGlobalProperties(); + + // if the ip we want a port on is an 'any' or loopback port we need to exclude all ports that are active on any IP + Func isIpAnyOrLoopBack = i => IPAddress.Any.Equals(i) || + IPAddress.IPv6Any.Equals(i) || + IPAddress.Loopback.Equals(i) || + IPAddress.IPv6Loopback. + Equals(i); + // get all active ports on specified IP. + List excludedPorts = new List(); + + // if a port is open on an 'any' or 'loopback' interface then include it in the excludedPorts + excludedPorts.AddRange(from n in ipProps.GetActiveTcpConnections() + where + n.LocalEndPoint.Port >= rangeStart && + n.LocalEndPoint.Port <= rangeEnd && ( + isIpAnyOrLoopBack(ip) || + n.LocalEndPoint.Address.Equals(ip) || + isIpAnyOrLoopBack(n.LocalEndPoint.Address)) && + (!includeIdlePorts || n.State != TcpState.TimeWait) + select (ushort) n.LocalEndPoint.Port); + + excludedPorts.AddRange(from n in ipProps.GetActiveTcpListeners() + where n.Port >= rangeStart && n.Port <= rangeEnd && ( + isIpAnyOrLoopBack(ip) || + n.Address.Equals(ip) || + isIpAnyOrLoopBack(n.Address)) + select (ushort) n.Port); + + excludedPorts.AddRange(from n in ipProps.GetActiveUdpListeners() + where n.Port >= rangeStart && n.Port <= rangeEnd && ( + isIpAnyOrLoopBack(ip) || + n.Address.Equals(ip) || + isIpAnyOrLoopBack(n.Address)) + select (ushort) n.Port); + + excludedPorts.Sort(); + + for (int port = rangeStart; port <= rangeEnd; port++) + { + if (!excludedPorts.Contains((ushort) port)) + { + return port; + } + } + + return 0; + } + + /// + /// Returns the first IPV4 address available for this host. + /// This is typically an external IP + /// + /// + public static IPAddress GetExternalIPV4() + { + return GetIPAdresses().ToList() + .FirstOrDefault(i => i.ToString().IndexOf(":") == -1); + } + + /// + /// + /// + public static string GetHostName() + { + return Dns.GetHostName(); + } + + /// + /// Gets all IP addresses for this host + /// + public static IPAddress[] GetIPAdresses() + { + return Dns.GetHostEntry(GetHostName()).AddressList; + } + + /// + /// Gently polls specified IP:Port to determine if it is available. + /// + /// + /// + public static bool IsPortAvailable(IPAddress ipAddress, int port) + { + bool portAvailable = false; + + for (int i = 0; i < 5; i++) + { + portAvailable = GetAvailablePort(port, port, ipAddress, true) == port; + if (portAvailable) + { + break; + } + // be a little patient and wait for the port if necessary, + // the previous occupant may have just vacated + Thread.Sleep(100); + } + return portAvailable; + } + + /// + /// Combine the RootUrl of the running web application with the relative url + /// specified. + /// + /// + /// + /// + public static string NormalizeUrl(string rootUrl, string relativeUrl) + { + relativeUrl = relativeUrl.TrimStart(new[] {'/'}); + + if (!rootUrl.EndsWith("/")) + { + rootUrl += "/"; + } + return new Uri(rootUrl + relativeUrl).ToString(); + } + + /// + /// + /// + /// + public static IPAddress ParseIPString(string ipString) + { + if (string.IsNullOrEmpty(ipString)) + { + ipString = "loopback"; + } + ipString = ipString.Trim().ToLower(); + switch (ipString) + { + case "any": + return IPAddress.Any; + case "loopback": + return IPAddress.Loopback; + case "ipv6any": + return IPAddress.IPv6Any; + case "ipv6loopback": + return IPAddress.IPv6Loopback; + default: + IPAddress result; + IPAddress.TryParse(ipString, out result); + return result; + } + } + + /// + /// + /// Hostnames are composed of series of labels concatenated with dots, as are all domain names[1]. + /// For example, "en.wikipedia.org" is a hostname. Each label must be between 1 and 63 characters long, + /// and the entire hostname has a maximum of 255 characters. + /// + /// The Internet standards (Request for Comments) for protocols mandate that component hostname + /// labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits + /// '0' through '9', and the hyphen. The original specification of hostnames in RFC 952, mandated that + /// labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a + /// subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, + /// punctuation characters, or blank spaces are permitted. + /// + /// + /// + /// http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names + public static bool ValidateHostName(string hostname) + { + Regex hostnameRx = + new Regex( + @"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$"); + return hostnameRx.IsMatch(hostname); + } + } +} \ No newline at end of file diff --git a/CassiniDev/Misc/ServiceInstaller.cs b/CassiniDev/Misc/ServiceInstaller.cs new file mode 100644 index 000000000..a12bf4f63 --- /dev/null +++ b/CassiniDev/Misc/ServiceInstaller.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration.Install; +using System.Linq; +using System.ServiceProcess; +using System.Text; +using System.Configuration; +namespace CassiniDev +{ + + + [RunInstaller(true)] + public sealed class MyServiceInstallerProcess : ServiceProcessInstaller + { + public MyServiceInstallerProcess() + { + this.Account = ServiceAccount.NetworkService; + + } + } + [RunInstaller(true)] + public sealed class MyServiceInstaller : ServiceInstaller + { + public MyServiceInstaller() + { + + + this.Description = "CassiniDev"; + this.DisplayName = "CassiniDev"; + this.ServiceName = "CassiniDev"; + this.StartType = System.ServiceProcess.ServiceStartMode.Automatic; + } + } + +} diff --git a/CassiniDev/Program.cs b/CassiniDev/Program.cs new file mode 100644 index 000000000..bd3526de1 --- /dev/null +++ b/CassiniDev/Program.cs @@ -0,0 +1,386 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.htm file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections; +using System.Configuration.Install; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Threading; +using System.Windows.Forms; +using CassiniDev.UIComponents; + +#endregion + +namespace CassiniDev +{ + public sealed class Program + { + + + [STAThread, LoaderOptimization(LoaderOptimization.MultiDomainHost)] + public static int Main(string[] cmdLine) + { + Server server = null; + + if (cmdLine != null && cmdLine.Length > 0) + { + bool isVS = Assembly.GetExecutingAssembly() + .GetName().Name.StartsWith("WEBDEV.WEBSERVER", StringComparison.OrdinalIgnoreCase); + + CommandLineArguments args = new CommandLineArguments(); + + if (!CommandLineParser.ParseArgumentsWithUsage(cmdLine, args)) + { + if (isVS) + { + // will display vs usage and return a code that VS understands + return ValidateForVS(cmdLine); + } + + string usage = CommandLineParser.ArgumentsUsage(typeof(CommandLineArguments), 120); + ShowMessage(usage, MessageBoxIcon.Asterisk); + return 0; + } + + + if (args.RunMode == RunMode.Hostsfile) + { + SetHostsFile(args); + return 0; + } + + + // now we validate for us. + int returnValue = -1; + string message = null; + + try + { + args.VisualStudio = isVS; + args.Validate(); + } + catch (CassiniException ex) + { + switch (ex.Message) + { + case SR.ErrNoAvailablePortFound: + case SR.ErrApplicationPathIsNull: + message = ex.Message; + break; + case SR.ErrInvalidIPMode: + message = SR.GetString(ex.Message, args.IPMode); + break; + case SR.ErrInvalidPortMode: + message = SR.GetString(ex.Message, args.PortMode); + break; + case SR.ErrPortIsInUse: + message = SR.GetString(ex.Message, args.Port); + break; + case SR.ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta: + message = SR.GetString(ex.Message, args.PortRangeStart, args.PortRangeEnd); + break; + case SR.ErrInvalidPortRangeValue: + message = SR.GetString(ex.Message, + ex.Field == ErrorField.PortRangeStart + ? "start " + args.PortRangeStart + : "end " + args.PortRangeEnd); + break; + case SR.ErrInvalidHostname: + message = SR.GetString(ex.Message, args.HostName); + break; + case SR.WebdevDirNotExist: + message = SR.GetString(ex.Message, args.ApplicationPath); + returnValue = -2; + break; + case SR.ErrPortOutOfRange: + message = SR.GetString(ex.Message, args.Port); + break; + } + + if (!args.Silent) + { + ShowMessage(message, MessageBoxIcon.Asterisk); + } + return returnValue; + } + catch (Exception exception) + { + if (!args.Silent) + { + ShowMessage(SR.GetString(SR.ErrFailedToStartCassiniDevServerOnPortError, args.Port, + exception.Message, exception.HelpLink), MessageBoxIcon.Error); + } + return -1; + } + + + + server = new Server(args.Port, args.VirtualPath, args.ApplicationPath, args.Ntlm, args.Nodirlist); + + + if (args.AddHost) + { + HostsFile.AddHostEntry(server.IPAddress.ToString(), server.HostName); + } + + try + { + server.Start(); + } + catch (Exception exception) + { + if (!args.Silent) + { + ShowMessage(SR.GetString(SR.ErrFailedToStartCassiniDevServerOnPortError, args.Port, + exception.Message, exception.HelpLink), MessageBoxIcon.Error); + } + return -4; + } + + } + + using (FormView form = new FormView(server)) + { + Application.Run(form); + } + + return 0; + } + + private static void ShowMessage(string msg, MessageBoxIcon icon) + { + if (Thread.CurrentThread.CurrentUICulture.TextInfo.IsRightToLeft) + { + MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, icon, + MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading); + } + else + { + MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, icon); + } + } + + private static void ShowMessage(string msg) + { + if (Thread.CurrentThread.CurrentUICulture.TextInfo.IsRightToLeft) + { + MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, MessageBoxIcon.Hand, + MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading); + } + else + { + MessageBox.Show(msg, SR.GetString(SR.WebdevName), MessageBoxButtons.OK, MessageBoxIcon.Hand); + } + } + + /// + /// TODO: update usage will all arguments and present on a legible substrate. + /// + private static void ShowUsage() + { + ShowMessage(SR.GetString(SR.WebdevUsagestr1) + SR.GetString(SR.WebdevUsagestr2) + + SR.GetString(SR.WebdevUsagestr3) + + SR.GetString(SR.WebdevUsagestr4) + SR.GetString(SR.WebdevUsagestr5) + + SR.GetString(SR.WebdevUsagestr6) + + SR.GetString(SR.WebdevUsagestr7), MessageBoxIcon.Asterisk); + } + + + /// + /// Keeping the VS validation to return codes that it likes. + /// + /// + /// + private static int ValidateForVS(string[] args) + { + CommandLine line = new CommandLine(args); + + bool flag = line.Options["silent"] != null; + + if (!flag && line.ShowHelp) + { + ShowUsage(); + return 0; + } + + string virtualPath = (string)line.Options["vpath"]; + + if (virtualPath != null) + { + virtualPath = virtualPath.Trim(); + } + + // we are being a bit generous here as CommandLineArguments can handle these sitchiashuns + if (string.IsNullOrEmpty(virtualPath)) + { + virtualPath = "/"; + } + + else if (!virtualPath.StartsWith("/", StringComparison.Ordinal)) + { + if (!flag) + { + ShowUsage(); + } + return -1; + } + + string path = (string)line.Options["path"]; + + if (path != null) + { + path = path.Trim(); + } + + if (string.IsNullOrEmpty(path)) + { + if (!flag) + { + ShowUsage(); + } + return -1; + } + + path = Path.GetFullPath(path); + + if (!Directory.Exists(path)) + { + if (!flag) + { + ShowMessage(SR.GetString(SR.WebdevDirNotExist, new object[] { path })); + } + return -2; + } + + int port = 0; + + string s = (string)line.Options["port"]; + + if (s != null) + { + s = s.Trim(); + } + + if (!string.IsNullOrEmpty(s)) + { + try + { + port = int.Parse(s, CultureInfo.InvariantCulture); + if ((port < 1) || (port > 0xffff)) + { + if (!flag) + { + ShowUsage(); + } + return -1; + } + + } + catch + { + if (!flag) + { + ShowMessage(SR.GetString(SR.WebdevInvalidPort, new object[] { s })); + } + return -3; + } + } + + if (!flag) + { + ShowUsage(); + } + + return 0; + } + + + private static void SetHostsFile(CommandLineArguments sargs) + { + try + { + if (sargs.AddHost) + { + HostsFile.AddHostEntry(sargs.IPAddress, sargs.HostName); + } + else + { + HostsFile.RemoveHostEntry(sargs.IPAddress, sargs.HostName); + } + } + catch (UnauthorizedAccessException) + { + Environment.Exit(-1); + } + catch + { + Environment.Exit(-2); + } + } + + + + } + + internal sealed class ServiceUtil + { + /// + /// http://stackoverflow.com/questions/1449994/inno-setup-for-windows-service + /// http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/4d45e9ea5471cba4/4519371a77ed4a74 + /// + /// + /// + public static void Install(bool undo, string[] args) + { + try + { + Console.WriteLine(undo ? "uninstalling" : "installing"); + using (AssemblyInstaller inst = new AssemblyInstaller(typeof(Program).Assembly, args)) + { + IDictionary state = new Hashtable(); + inst.UseNewContext = true; + try + { + if (undo) + { + inst.Uninstall(state); + } + else + { + inst.Install(state); + inst.Commit(state); + } + } + catch + { + try + { + inst.Rollback(state); + } + catch { } + throw; + } + } + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.Message); + } + } + } +} \ No newline at end of file diff --git a/CassiniDev/Properties/AssemblyInfo.cs b/CassiniDev/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..13a4100b0 --- /dev/null +++ b/CassiniDev/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System; +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +[assembly: AssemblyTitle("CassiniDev")] +[assembly: AssemblyDescription("Cassini For Developers")] +[assembly: AssemblyCompany("Salient Solutions")] +[assembly: AssemblyProduct("CassiniDev")] +[assembly: AssemblyCopyright("\x00a9 Sky Sanders/\x00a9 Microsoft Corporation. All rights reserved.")] +[assembly: NeutralResourcesLanguage("en-US")] +[assembly: AssemblyVersion("3.5.1.8")] +[assembly: AssemblyFileVersion("3.5.1.8")] +[assembly: ComVisible(false)] +[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] +[assembly: SecurityPermission(SecurityAction.RequestMinimum)] +[assembly: CLSCompliant(true)] diff --git a/CassiniDev/Properties/AssemblyInfo4.cs b/CassiniDev/Properties/AssemblyInfo4.cs new file mode 100644 index 000000000..8d9c630b0 --- /dev/null +++ b/CassiniDev/Properties/AssemblyInfo4.cs @@ -0,0 +1,19 @@ +using System; +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +[assembly: AssemblyTitle("CassiniDev")] +[assembly: AssemblyDescription("Cassini For Developers")] +[assembly: AssemblyCompany("Salient Solutions")] +[assembly: AssemblyProduct("CassiniDev")] +[assembly: AssemblyCopyright("\x00a9 Sky Sanders/\x00a9 Microsoft Corporation. All rights reserved.")] +[assembly: NeutralResourcesLanguage("en-US")] +[assembly: AssemblyVersion("4.0.1.8")] +[assembly: AssemblyFileVersion("4.0.1.8")] +[assembly: ComVisible(false)] +[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] +[assembly: SecurityPermission(SecurityAction.RequestMinimum)] +[assembly: CLSCompliant(true)] diff --git a/CassiniDev/Resources/CassiniDev.resx b/CassiniDev/Resources/CassiniDev.resx new file mode 100644 index 000000000..067380c9a --- /dev/null +++ b/CassiniDev/Resources/CassiniDev.resx @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Directory Listing -- {0} + + + CassiniDev Server + + + Server Error in '{0}' Application. + + + Version Information + + + HTTP Error {0} - {1}. + + + The directory '{0}' does not exist. + + + CassiniDev Server failed to start listening on port {0}. + Error message: + {1} + + + Invalid port'{0}' + + + CassiniDev Server + + + CassiniDev Server - Port {0} + + + Open in Web Browser + + + Run ASP.NET applications locally. + + + Show Details + + + Stop + + + CassiniDev Server Usage: + + + + WebDev.WebServer /port:<port number> /path:<physical path> [/vpath:<virtual path>] + + + + + port number: + [Optional] An unused port number between 1 and 65535. + The default is 80 (usable if you do not also have IIS listening on the same port). + + + + + physical path: + A valid directory name where the Web application is rooted. + + + + + virtual path: + [Optional] The virtual path or application root in the form of '/<app name>'. + The default is simply '/'. + + + + + Example: +WebDev.WebServer /port:8080 /path:"c:\inetpub\wwwroot\MyApp" /vpath:"/MyApp" + + + + + You can then access the Web application using a URL of the form: + http://localhost:8080/MyApp + + + CassiniDev Server - Port {0} - Log Viewer + + + In memory logging is enabled. + +Events are only captured when the Log window is visible +and all data will be lost when this window is closed. + +Install the latest System.Data.SQLite package to enable +log persistence. + + + ASP.Net Version: {0} + + + Start + + + ApplicationPath is null + + + Failed to start CassiniDev Server on Port:{0} Error:{1} {2} + + + Invalid Hostname {0} + + + Invalid IP Address {0} + + + Invalid IPMode {0} + + + Invalid PortMode + + + Invalid port range value {0} + + + No available port found. + + + Port is in use {0} + + + Port out of range: {0} + + + Port range end must be equal or greater than port range start {0} {1} + + \ No newline at end of file diff --git a/CassiniDev/Resources/SR.cs b/CassiniDev/Resources/SR.cs new file mode 100644 index 000000000..1101656c8 --- /dev/null +++ b/CassiniDev/Resources/SR.cs @@ -0,0 +1,164 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) Sky Sanders. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.htm file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Globalization; +using System.Reflection; +using System.Resources; +using System.Threading; + +#endregion + +namespace CassiniDev +{ + internal sealed class SR + { + + internal const string ErrInvalidIPMode="SR.ErrInvalidIPMode"; + internal const string ErrInvalidIPAddress = "ErrInvalidIPAddress"; + internal const string ErrInvalidPortMode = "ErrInvalidPortMode"; + internal const string ErrPortIsInUse = "ErrPortIsInUse"; + internal const string ErrNoAvailablePortFound = "ErrNoAvailablePortFound"; + internal const string ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta = + "ErrPortRangeEndMustBeEqualOrGreaterThanPortRangeSta"; + internal const string ErrInvalidPortRangeValue = "ErrInvalidPortRangeValue"; + internal const string ErrInvalidHostname = "ErrInvalidHostname"; + + internal const string ErrFailedToStartCassiniDevServerOnPortError = + "ErrFailedToStartCassiniDevServerOnPortError"; + internal const string ErrApplicationPathIsNull = "ErrApplicationPathIsNull"; + internal const string ErrPortOutOfRange = "ErrPortOutOfRange"; + + internal const string WebdevAspNetVersion = "WebdevAspNetVersion"; + + internal const string WebdevDirListing = "WebdevDirListing"; + + internal const string WebdevDirNotExist = "WebdevDirNotExist"; + + internal const string WebdevErrorListeningPort = "WebdevErrorListeningPort"; + + internal const string WebdevHttpError = "WebdevHttpError"; + + internal const string WebdevInMemoryLogging = "WebdevInMemoryLogging"; + + internal const string WebdevInvalidPort = "WebdevInvalidPort"; + + internal const string WebdevLogViewerNameWithPort = "WebdevLogViewerNameWithPort"; + + internal const string WebdevName = "WebdevName"; + + internal const string WebdevNameWithPort = "WebdevNameWithPort"; + + internal const string WebdevOpenInBrowser = "WebdevOpenInBrowser"; + + internal const string WebdevRunAspNetLocally = "WebdevRunAspNetLocally"; + + internal const string WebdevServerError = "WebdevServerError"; + + internal const string WebdevShowDetail = "WebdevShowDetail"; + + internal const string WebdevStop = "WebdevStop"; + + internal const string WebdevUsagestr1 = "WebdevUsagestr1"; + + internal const string WebdevUsagestr2 = "WebdevUsagestr2"; + + internal const string WebdevUsagestr3 = "WebdevUsagestr3"; + + internal const string WebdevUsagestr4 = "WebdevUsagestr4"; + + internal const string WebdevUsagestr5 = "WebdevUsagestr5"; + + internal const string WebdevUsagestr6 = "WebdevUsagestr6"; + + internal const string WebdevUsagestr7 = "WebdevUsagestr7"; + + internal const string WebdevVersionInfo = "WebdevVersionInfo"; + + internal const string WebdevVwdName = "WebdevVwdName"; + + private static SR _loader; + + private readonly ResourceManager _resources; + public const string WebdevStart = "WebdevStart"; + + internal SR() + { + Type t = GetType(); + Assembly thisAssembly = t.Assembly; + string stringResourcesName = t.Namespace + ".Resources.CassiniDev"; + _resources = new ResourceManager(stringResourcesName, thisAssembly); + } + + private static CultureInfo Culture + { + get { return null; } + } + + public static ResourceManager Resources + { + get { return GetLoader()._resources; } + } + + public static string GetString(string name) + { + SR loader = GetLoader(); + if (loader == null) + { + return null; + } + return loader._resources.GetString(name, Culture); + } + + public static string GetString(string name, params object[] args) + { + SR loader = GetLoader(); + if (loader == null) + { + return null; + } + string format = loader._resources.GetString(name, Culture); + if ((args == null) || (args.Length <= 0)) + { + return format; + } + for (int i = 0; i < args.Length; i++) + { + string str2 = args[i] as string; + if ((str2 != null) && (str2.Length > 0x400)) + { + args[i] = str2.Substring(0, 0x3fd) + "..."; + } + } + if (string.IsNullOrEmpty(format)) + { + return string.Empty; + } + return string.Format(CultureInfo.CurrentCulture, format, args); + } + + private static SR GetLoader() + { + if (_loader == null) + { + SR sr = new SR(); + Interlocked.CompareExchange(ref _loader, sr, null); + } + return _loader; + } + + } +} \ No newline at end of file diff --git a/CassiniDev/Resources/preferences-web-browser-shortcuts.ico b/CassiniDev/Resources/preferences-web-browser-shortcuts.ico new file mode 100644 index 000000000..472a8ede1 Binary files /dev/null and b/CassiniDev/Resources/preferences-web-browser-shortcuts.ico differ diff --git a/CassiniDev/Views/BodyView.Designer.cs b/CassiniDev/Views/BodyView.Designer.cs new file mode 100644 index 000000000..3f039539a --- /dev/null +++ b/CassiniDev/Views/BodyView.Designer.cs @@ -0,0 +1,187 @@ +namespace CassiniDev.ServerLog +{ + partial class BodyView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.TextViewTab = new System.Windows.Forms.TabPage(); + this.TextViewTextBox = new System.Windows.Forms.RichTextBox(); + this.HexViewTab = new System.Windows.Forms.TabPage(); + this.HexViewTextBox = new System.Windows.Forms.RichTextBox(); + this.ImageViewTab = new System.Windows.Forms.TabPage(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.tabControl1.SuspendLayout(); + this.TextViewTab.SuspendLayout(); + this.HexViewTab.SuspendLayout(); + this.ImageViewTab.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.SuspendLayout(); + // + // pictureBox1 + // + this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox1.Location = new System.Drawing.Point(4, 4); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(271, 123); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.TextViewTab); + this.tabControl1.Controls.Add(this.HexViewTab); + this.tabControl1.Controls.Add(this.ImageViewTab); + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(287, 157); + this.tabControl1.TabIndex = 2; + // + // TextViewTab + // + this.TextViewTab.Controls.Add(this.TextViewTextBox); + this.TextViewTab.Location = new System.Drawing.Point(4, 22); + this.TextViewTab.Name = "TextViewTab"; + this.TextViewTab.Padding = new System.Windows.Forms.Padding(3); + this.TextViewTab.Size = new System.Drawing.Size(279, 131); + this.TextViewTab.TabIndex = 1; + this.TextViewTab.Text = "TextView"; + this.TextViewTab.UseVisualStyleBackColor = true; + // + // TextViewTextBox + // + this.TextViewTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.TextViewTextBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.TextViewTextBox.Location = new System.Drawing.Point(3, 3); + this.TextViewTextBox.Name = "TextViewTextBox"; + this.TextViewTextBox.ReadOnly = true; + this.TextViewTextBox.Size = new System.Drawing.Size(273, 125); + this.TextViewTextBox.TabIndex = 0; + this.TextViewTextBox.Text = ""; + this.toolTip1.SetToolTip(this.TextViewTextBox, "CTRL+ Mouse Wheel to Zoom"); + this.TextViewTextBox.WordWrap = false; + // + // HexViewTab + // + this.HexViewTab.Controls.Add(this.HexViewTextBox); + this.HexViewTab.Location = new System.Drawing.Point(4, 22); + this.HexViewTab.Name = "HexViewTab"; + this.HexViewTab.Padding = new System.Windows.Forms.Padding(3); + this.HexViewTab.Size = new System.Drawing.Size(279, 131); + this.HexViewTab.TabIndex = 0; + this.HexViewTab.Text = "HexView"; + this.HexViewTab.UseVisualStyleBackColor = true; + // + // HexViewTextBox + // + this.HexViewTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.HexViewTextBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.HexViewTextBox.Location = new System.Drawing.Point(3, 3); + this.HexViewTextBox.Name = "HexViewTextBox"; + this.HexViewTextBox.ReadOnly = true; + this.HexViewTextBox.Size = new System.Drawing.Size(273, 125); + this.HexViewTextBox.TabIndex = 1; + this.HexViewTextBox.Text = ""; + this.toolTip1.SetToolTip(this.HexViewTextBox, "CTRL+ Mouse Wheel to Zoom"); + this.HexViewTextBox.WordWrap = false; + // + // ImageViewTab + // + this.ImageViewTab.AutoScroll = true; + this.ImageViewTab.Controls.Add(this.pictureBox1); + this.ImageViewTab.Location = new System.Drawing.Point(4, 22); + this.ImageViewTab.Name = "ImageViewTab"; + this.ImageViewTab.Padding = new System.Windows.Forms.Padding(4); + this.ImageViewTab.Size = new System.Drawing.Size(279, 131); + this.ImageViewTab.TabIndex = 2; + this.ImageViewTab.Text = "ImageView"; + this.ImageViewTab.UseVisualStyleBackColor = true; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.richTextBox1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Size = new System.Drawing.Size(279, 131); + this.tabPage1.TabIndex = 3; + this.tabPage1.Text = "TODO"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // richTextBox1 + // + this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.richTextBox1.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.richTextBox1.Location = new System.Drawing.Point(0, 0); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.ReadOnly = true; + this.richTextBox1.Size = new System.Drawing.Size(279, 131); + this.richTextBox1.TabIndex = 2; + this.richTextBox1.Text = "Expose extension API, probably via MEF, to enable incremental implemention of add" + + "itional views, e.g. a PDF view, a XAML view"; + this.toolTip1.SetToolTip(this.richTextBox1, "CTRL+ Mouse Wheel to Zoom"); + // + // BodyView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.GradientActiveCaption; + this.Controls.Add(this.tabControl1); + this.Name = "BodyView"; + this.Size = new System.Drawing.Size(287, 157); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.tabControl1.ResumeLayout(false); + this.TextViewTab.ResumeLayout(false); + this.HexViewTab.ResumeLayout(false); + this.ImageViewTab.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage HexViewTab; + private System.Windows.Forms.RichTextBox HexViewTextBox; + private System.Windows.Forms.TabPage TextViewTab; + private System.Windows.Forms.RichTextBox TextViewTextBox; + private System.Windows.Forms.TabPage ImageViewTab; + private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.RichTextBox richTextBox1; + } +} diff --git a/CassiniDev/Views/BodyView.cs b/CassiniDev/Views/BodyView.cs new file mode 100644 index 000000000..0068c817b --- /dev/null +++ b/CassiniDev/Views/BodyView.cs @@ -0,0 +1,77 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.htm file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +#endregion + +namespace CassiniDev.ServerLog +{ + [DefaultBindingProperty("Value")] + public partial class BodyView : UserControl + { + private byte[] _value; + + public BodyView() + { + InitializeComponent(); + pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; + } + + public Byte[] Value + { + get { return _value; } + set + { + _value = value; + ClearDisplay(); + if (_value != null) + { + HexViewTextBox.Text = _value.ConvertToHexView(8); + TextViewTextBox.Text = Encoding.UTF8.GetString(_value); + try + { + using (MemoryStream s = new MemoryStream(_value)) + { + pictureBox1.Image = Image.FromStream(s); + } + pictureBox1.Visible = true; + } + // ReSharper disable EmptyGeneralCatchClause + catch + // ReSharper restore EmptyGeneralCatchClause + { + } + } + } + } + + private void ClearDisplay() + { + if (pictureBox1.Image != null) + { + pictureBox1.Image.Dispose(); + pictureBox1.Image = null; + } + HexViewTextBox.Text = ""; + TextViewTextBox.Text = ""; + } + } +} \ No newline at end of file diff --git a/CassiniDev/Views/BodyView.resx b/CassiniDev/Views/BodyView.resx new file mode 100644 index 000000000..9454f3d77 --- /dev/null +++ b/CassiniDev/Views/BodyView.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/CassiniDev/Views/FormView.Designer.cs b/CassiniDev/Views/FormView.Designer.cs new file mode 100644 index 000000000..ca1f1b0d3 --- /dev/null +++ b/CassiniDev/Views/FormView.Designer.cs @@ -0,0 +1,686 @@ +namespace CassiniDev +{ + partial class FormView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormView)); + this.RootUrlLinkLabel = new System.Windows.Forms.LinkLabel(); + this.ApplicationPathTextBox = new System.Windows.Forms.TextBox(); + this.VirtualPathTextBox = new System.Windows.Forms.TextBox(); + this.HostNameTextBox = new System.Windows.Forms.TextBox(); + this.LabelPhysicalPath = new System.Windows.Forms.Label(); + this.AddHostEntryCheckBox = new System.Windows.Forms.CheckBox(); + this.LabelVPath = new System.Windows.Forms.Label(); + this.ButtonBrowsePhysicalPath = new System.Windows.Forms.Button(); + this.LabelHostName = new System.Windows.Forms.Label(); + this.GroupBoxPort = new System.Windows.Forms.GroupBox(); + this.PortRangeEndTextBox = new System.Windows.Forms.NumericUpDown(); + this.PortRangeStartTextBox = new System.Windows.Forms.NumericUpDown(); + this.PortTextBox = new System.Windows.Forms.NumericUpDown(); + this.LabelPortRangeSeperator = new System.Windows.Forms.Label(); + this.PortModeFirstAvailableRadioButton = new System.Windows.Forms.RadioButton(); + this.PortModeSpecificRadioButton = new System.Windows.Forms.RadioButton(); + this.GroupBoxIPAddress = new System.Windows.Forms.GroupBox(); + this.IPSpecificTextBox = new System.Windows.Forms.ComboBox(); + this.IPV6CheckBox = new System.Windows.Forms.CheckBox(); + this.RadioButtonIPSpecific = new System.Windows.Forms.RadioButton(); + this.IPModeAnyRadioButton = new System.Windows.Forms.RadioButton(); + this.IPModeLoopBackRadioButton = new System.Windows.Forms.RadioButton(); + this.ButtonStart = new System.Windows.Forms.Button(); + this.errorProvider1 = new System.Windows.Forms.ErrorProvider(this.components); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.LabelIdleTimeOut = new System.Windows.Forms.Label(); + this.TrayIcon = new System.Windows.Forms.NotifyIcon(this.components); + this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.browseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.ShowLogMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.ShowLogButton = new System.Windows.Forms.Button(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.hideToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.nTLMAuthenticationRequiredToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.directoryBrowsingEnabledToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.TimeOutNumeric = new System.Windows.Forms.NumericUpDown(); + this.GroupBoxPort.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.PortRangeEndTextBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PortRangeStartTextBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.PortTextBox)).BeginInit(); + this.GroupBoxIPAddress.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).BeginInit(); + this.contextMenuStrip1.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.TimeOutNumeric)).BeginInit(); + this.SuspendLayout(); + // + // RootUrlLinkLabel + // + this.RootUrlLinkLabel.AutoSize = true; + this.RootUrlLinkLabel.Location = new System.Drawing.Point(9, 300); + this.RootUrlLinkLabel.Name = "RootUrlLinkLabel"; + this.RootUrlLinkLabel.Size = new System.Drawing.Size(189, 13); + this.RootUrlLinkLabel.TabIndex = 24; + this.RootUrlLinkLabel.TabStop = true; + this.RootUrlLinkLabel.Text = "XXXXXXXXXXXXXXXXXXXXXXXXXX"; + this.RootUrlLinkLabel.Visible = false; + this.RootUrlLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LaunchBrowser); + // + // ApplicationPathTextBox + // + this.ApplicationPathTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.ApplicationPathTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystemDirectories; + this.ApplicationPathTextBox.Location = new System.Drawing.Point(12, 53); + this.ApplicationPathTextBox.Name = "ApplicationPathTextBox"; + this.ApplicationPathTextBox.Size = new System.Drawing.Size(285, 20); + this.ApplicationPathTextBox.TabIndex = 0; + this.toolTip1.SetToolTip(this.ApplicationPathTextBox, "The physical directory of the web application or site to serve."); + // + // VirtualPathTextBox + // + this.VirtualPathTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.VirtualPathTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.RecentlyUsedList; + this.VirtualPathTextBox.Location = new System.Drawing.Point(12, 92); + this.VirtualPathTextBox.Name = "VirtualPathTextBox"; + this.VirtualPathTextBox.Size = new System.Drawing.Size(317, 20); + this.VirtualPathTextBox.TabIndex = 2; + this.VirtualPathTextBox.Text = "/"; + this.toolTip1.SetToolTip(this.VirtualPathTextBox, "The virtual path upon which to root the application."); + // + // HostNameTextBox + // + this.HostNameTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.HostNameTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.RecentlyUsedList; + this.HostNameTextBox.Location = new System.Drawing.Point(12, 131); + this.HostNameTextBox.Name = "HostNameTextBox"; + this.HostNameTextBox.Size = new System.Drawing.Size(213, 20); + this.HostNameTextBox.TabIndex = 3; + this.toolTip1.SetToolTip(this.HostNameTextBox, resources.GetString("HostNameTextBox.ToolTip")); + this.HostNameTextBox.TextChanged += new System.EventHandler(this.HostNameChanged); + // + // LabelPhysicalPath + // + this.LabelPhysicalPath.AutoSize = true; + this.LabelPhysicalPath.Location = new System.Drawing.Point(12, 36); + this.LabelPhysicalPath.Name = "LabelPhysicalPath"; + this.LabelPhysicalPath.Size = new System.Drawing.Size(71, 13); + this.LabelPhysicalPath.TabIndex = 1; + this.LabelPhysicalPath.Text = "Physical Path"; + this.toolTip1.SetToolTip(this.LabelPhysicalPath, "The physical directory of the web application or site to serve."); + // + // AddHostEntryCheckBox + // + this.AddHostEntryCheckBox.AutoSize = true; + this.AddHostEntryCheckBox.Enabled = false; + this.AddHostEntryCheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.AddHostEntryCheckBox.Location = new System.Drawing.Point(231, 133); + this.AddHostEntryCheckBox.Name = "AddHostEntryCheckBox"; + this.AddHostEntryCheckBox.Size = new System.Drawing.Size(105, 18); + this.AddHostEntryCheckBox.TabIndex = 4; + this.AddHostEntryCheckBox.Text = "Add hosts entry"; + this.toolTip1.SetToolTip(this.AddHostEntryCheckBox, resources.GetString("AddHostEntryCheckBox.ToolTip")); + this.AddHostEntryCheckBox.UseVisualStyleBackColor = true; + // + // LabelVPath + // + this.LabelVPath.AutoSize = true; + this.LabelVPath.Location = new System.Drawing.Point(12, 75); + this.LabelVPath.Name = "LabelVPath"; + this.LabelVPath.Size = new System.Drawing.Size(61, 13); + this.LabelVPath.TabIndex = 3; + this.LabelVPath.Text = "Virtual Path"; + this.toolTip1.SetToolTip(this.LabelVPath, "The virtual path upon which to root the application."); + // + // ButtonBrowsePhysicalPath + // + this.ButtonBrowsePhysicalPath.Location = new System.Drawing.Point(303, 50); + this.ButtonBrowsePhysicalPath.Name = "ButtonBrowsePhysicalPath"; + this.ButtonBrowsePhysicalPath.Size = new System.Drawing.Size(27, 23); + this.ButtonBrowsePhysicalPath.TabIndex = 1; + this.ButtonBrowsePhysicalPath.Text = "..."; + this.toolTip1.SetToolTip(this.ButtonBrowsePhysicalPath, "Browse"); + this.ButtonBrowsePhysicalPath.UseVisualStyleBackColor = true; + this.ButtonBrowsePhysicalPath.Click += new System.EventHandler(this.BrowsePath); + // + // LabelHostName + // + this.LabelHostName.AutoSize = true; + this.LabelHostName.Location = new System.Drawing.Point(12, 115); + this.LabelHostName.Name = "LabelHostName"; + this.LabelHostName.Size = new System.Drawing.Size(106, 13); + this.LabelHostName.TabIndex = 5; + this.LabelHostName.Text = "Host Name (optional)"; + this.toolTip1.SetToolTip(this.LabelHostName, resources.GetString("LabelHostName.ToolTip")); + // + // GroupBoxPort + // + this.GroupBoxPort.Controls.Add(this.PortRangeEndTextBox); + this.GroupBoxPort.Controls.Add(this.PortRangeStartTextBox); + this.GroupBoxPort.Controls.Add(this.PortTextBox); + this.GroupBoxPort.Controls.Add(this.LabelPortRangeSeperator); + this.GroupBoxPort.Controls.Add(this.PortModeFirstAvailableRadioButton); + this.GroupBoxPort.Controls.Add(this.PortModeSpecificRadioButton); + this.GroupBoxPort.Location = new System.Drawing.Point(12, 213); + this.GroupBoxPort.Name = "GroupBoxPort"; + this.GroupBoxPort.Size = new System.Drawing.Size(324, 47); + this.GroupBoxPort.TabIndex = 9; + this.GroupBoxPort.TabStop = false; + this.GroupBoxPort.Text = "Port"; + // + // PortRangeEndTextBox + // + this.PortRangeEndTextBox.Location = new System.Drawing.Point(261, 12); + this.PortRangeEndTextBox.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.PortRangeEndTextBox.Minimum = new decimal(new int[] { + 2, + 0, + 0, + 0}); + this.PortRangeEndTextBox.Name = "PortRangeEndTextBox"; + this.PortRangeEndTextBox.Size = new System.Drawing.Size(57, 20); + this.PortRangeEndTextBox.TabIndex = 19; + this.PortRangeEndTextBox.Value = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + // + // PortRangeStartTextBox + // + this.PortRangeStartTextBox.Location = new System.Drawing.Point(182, 12); + this.PortRangeStartTextBox.Maximum = new decimal(new int[] { + 65534, + 0, + 0, + 0}); + this.PortRangeStartTextBox.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.PortRangeStartTextBox.Name = "PortRangeStartTextBox"; + this.PortRangeStartTextBox.Size = new System.Drawing.Size(57, 20); + this.PortRangeStartTextBox.TabIndex = 18; + this.PortRangeStartTextBox.Value = new decimal(new int[] { + 32768, + 0, + 0, + 0}); + // + // PortTextBox + // + this.PortTextBox.Location = new System.Drawing.Point(65, 12); + this.PortTextBox.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.PortTextBox.Name = "PortTextBox"; + this.PortTextBox.Size = new System.Drawing.Size(57, 20); + this.PortTextBox.TabIndex = 17; + // + // LabelPortRangeSeperator + // + this.LabelPortRangeSeperator.AutoSize = true; + this.LabelPortRangeSeperator.Location = new System.Drawing.Point(239, 16); + this.LabelPortRangeSeperator.Name = "LabelPortRangeSeperator"; + this.LabelPortRangeSeperator.Size = new System.Drawing.Size(22, 13); + this.LabelPortRangeSeperator.TabIndex = 16; + this.LabelPortRangeSeperator.Text = "<->"; + this.toolTip1.SetToolTip(this.LabelPortRangeSeperator, "Host on the first available port found in specified range."); + // + // PortModeFirstAvailableRadioButton + // + this.PortModeFirstAvailableRadioButton.AutoSize = true; + this.PortModeFirstAvailableRadioButton.Checked = true; + this.PortModeFirstAvailableRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.PortModeFirstAvailableRadioButton.Location = new System.Drawing.Point(128, 13); + this.PortModeFirstAvailableRadioButton.Name = "PortModeFirstAvailableRadioButton"; + this.PortModeFirstAvailableRadioButton.Size = new System.Drawing.Size(63, 18); + this.PortModeFirstAvailableRadioButton.TabIndex = 6; + this.PortModeFirstAvailableRadioButton.TabStop = true; + this.PortModeFirstAvailableRadioButton.Text = "Range"; + this.toolTip1.SetToolTip(this.PortModeFirstAvailableRadioButton, "Host on the first available port found in specified range."); + this.PortModeFirstAvailableRadioButton.UseVisualStyleBackColor = true; + this.PortModeFirstAvailableRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonPortFind_CheckedChanged); + // + // PortModeSpecificRadioButton + // + this.PortModeSpecificRadioButton.AutoSize = true; + this.PortModeSpecificRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.PortModeSpecificRadioButton.Location = new System.Drawing.Point(6, 13); + this.PortModeSpecificRadioButton.Name = "PortModeSpecificRadioButton"; + this.PortModeSpecificRadioButton.Size = new System.Drawing.Size(69, 18); + this.PortModeSpecificRadioButton.TabIndex = 6; + this.PortModeSpecificRadioButton.TabStop = true; + this.PortModeSpecificRadioButton.Text = "Specific"; + this.toolTip1.SetToolTip(this.PortModeSpecificRadioButton, "Host on specific port. \r\nIf port is already in use a warning will be issued and s" + + "erver will not start."); + this.PortModeSpecificRadioButton.UseVisualStyleBackColor = true; + this.PortModeSpecificRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonPortSpecific_CheckedChanged); + // + // GroupBoxIPAddress + // + this.GroupBoxIPAddress.Controls.Add(this.IPSpecificTextBox); + this.GroupBoxIPAddress.Controls.Add(this.IPV6CheckBox); + this.GroupBoxIPAddress.Controls.Add(this.RadioButtonIPSpecific); + this.GroupBoxIPAddress.Controls.Add(this.IPModeAnyRadioButton); + this.GroupBoxIPAddress.Controls.Add(this.IPModeLoopBackRadioButton); + this.GroupBoxIPAddress.Location = new System.Drawing.Point(12, 154); + this.GroupBoxIPAddress.Name = "GroupBoxIPAddress"; + this.GroupBoxIPAddress.Size = new System.Drawing.Size(324, 58); + this.GroupBoxIPAddress.TabIndex = 8; + this.GroupBoxIPAddress.TabStop = false; + this.GroupBoxIPAddress.Text = "IP Address"; + // + // IPSpecificTextBox + // + this.IPSpecificTextBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.IPSpecificTextBox.FormattingEnabled = true; + this.IPSpecificTextBox.Location = new System.Drawing.Point(216, 14); + this.IPSpecificTextBox.Name = "IPSpecificTextBox"; + this.IPSpecificTextBox.Size = new System.Drawing.Size(101, 21); + this.IPSpecificTextBox.TabIndex = 9; + // + // IPV6CheckBox + // + this.IPV6CheckBox.AutoSize = true; + this.IPV6CheckBox.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.IPV6CheckBox.Location = new System.Drawing.Point(39, 35); + this.IPV6CheckBox.Name = "IPV6CheckBox"; + this.IPV6CheckBox.Size = new System.Drawing.Size(77, 18); + this.IPV6CheckBox.TabIndex = 8; + this.IPV6CheckBox.Text = "Use IPV6"; + this.toolTip1.SetToolTip(this.IPV6CheckBox, "Use the IPV6 version of selected IP"); + this.IPV6CheckBox.UseVisualStyleBackColor = true; + // + // RadioButtonIPSpecific + // + this.RadioButtonIPSpecific.AutoSize = true; + this.RadioButtonIPSpecific.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.RadioButtonIPSpecific.Location = new System.Drawing.Point(150, 15); + this.RadioButtonIPSpecific.Name = "RadioButtonIPSpecific"; + this.RadioButtonIPSpecific.Size = new System.Drawing.Size(69, 18); + this.RadioButtonIPSpecific.TabIndex = 5; + this.RadioButtonIPSpecific.Text = "Specific"; + this.toolTip1.SetToolTip(this.RadioButtonIPSpecific, "Host on specified IP address.\r\nWCF Services may not be served using this setting." + + " Use Loopback."); + this.RadioButtonIPSpecific.UseVisualStyleBackColor = true; + this.RadioButtonIPSpecific.CheckedChanged += new System.EventHandler(this.RadioButtonIPSpecific_CheckedChanged); + // + // IPModeAnyRadioButton + // + this.IPModeAnyRadioButton.AutoSize = true; + this.IPModeAnyRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.IPModeAnyRadioButton.Location = new System.Drawing.Point(88, 15); + this.IPModeAnyRadioButton.Name = "IPModeAnyRadioButton"; + this.IPModeAnyRadioButton.Size = new System.Drawing.Size(49, 18); + this.IPModeAnyRadioButton.TabIndex = 5; + this.IPModeAnyRadioButton.Text = "Any"; + this.toolTip1.SetToolTip(this.IPModeAnyRadioButton, "Host on all IP addresses at the specified port.\r\nWCF Services may not be served u" + + "sing this setting. Use Loopback."); + this.IPModeAnyRadioButton.UseVisualStyleBackColor = true; + this.IPModeAnyRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonIPAny_CheckedChanged); + // + // IPModeLoopBackRadioButton + // + this.IPModeLoopBackRadioButton.AutoSize = true; + this.IPModeLoopBackRadioButton.Checked = true; + this.IPModeLoopBackRadioButton.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.IPModeLoopBackRadioButton.Location = new System.Drawing.Point(6, 15); + this.IPModeLoopBackRadioButton.Name = "IPModeLoopBackRadioButton"; + this.IPModeLoopBackRadioButton.Size = new System.Drawing.Size(79, 18); + this.IPModeLoopBackRadioButton.TabIndex = 5; + this.IPModeLoopBackRadioButton.TabStop = true; + this.IPModeLoopBackRadioButton.Text = "Loopback"; + this.toolTip1.SetToolTip(this.IPModeLoopBackRadioButton, "Use the default loopback adapter. \r\nIf any sort of WCF service is to be served, t" + + "his is the only viable option."); + this.IPModeLoopBackRadioButton.UseVisualStyleBackColor = true; + this.IPModeLoopBackRadioButton.CheckedChanged += new System.EventHandler(this.RadioButtonIPLoopBack_CheckedChanged); + // + // ButtonStart + // + this.ButtonStart.Location = new System.Drawing.Point(261, 335); + this.ButtonStart.Name = "ButtonStart"; + this.ButtonStart.Size = new System.Drawing.Size(75, 23); + this.ButtonStart.TabIndex = 22; + this.ButtonStart.Text = "Start"; + this.toolTip1.SetToolTip(this.ButtonStart, "Start hosting application using specified criteria"); + this.ButtonStart.UseVisualStyleBackColor = true; + this.ButtonStart.Click += new System.EventHandler(this.StartStop); + // + // errorProvider1 + // + this.errorProvider1.ContainerControl = this; + // + // LabelIdleTimeOut + // + this.LabelIdleTimeOut.AutoSize = true; + this.LabelIdleTimeOut.Location = new System.Drawing.Point(15, 270); + this.LabelIdleTimeOut.Name = "LabelIdleTimeOut"; + this.LabelIdleTimeOut.Size = new System.Drawing.Size(73, 13); + this.LabelIdleTimeOut.TabIndex = 26; + this.LabelIdleTimeOut.Text = "Idle Time Out:"; + this.toolTip1.SetToolTip(this.LabelIdleTimeOut, "The amount of time, in milliseconds, to remain idle, i.e. no requests, before sto" + + "pping the server."); + // + // TrayIcon + // + this.TrayIcon.ContextMenuStrip = this.contextMenuStrip1; + this.TrayIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("TrayIcon.Icon"))); + this.TrayIcon.Text = "notifyIcon1"; + this.TrayIcon.BalloonTipClicked += new System.EventHandler(this.ShowMainForm); + this.TrayIcon.DoubleClick += new System.EventHandler(this.ShowMainForm); + // + // contextMenuStrip1 + // + this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.showToolStripMenuItem, + this.browseToolStripMenuItem, + this.toolStripSeparator2, + this.ShowLogMenuItem, + this.toolStripSeparator1, + this.closeToolStripMenuItem, + this.helpToolStripMenuItem}); + this.contextMenuStrip1.Name = "contextMenuStrip1"; + this.contextMenuStrip1.Size = new System.Drawing.Size(117, 126); + // + // showToolStripMenuItem + // + this.showToolStripMenuItem.Name = "showToolStripMenuItem"; + this.showToolStripMenuItem.Size = new System.Drawing.Size(116, 22); + this.showToolStripMenuItem.Text = "&Show"; + this.showToolStripMenuItem.Click += new System.EventHandler(this.ShowMainForm); + // + // browseToolStripMenuItem + // + this.browseToolStripMenuItem.Name = "browseToolStripMenuItem"; + this.browseToolStripMenuItem.Size = new System.Drawing.Size(116, 22); + this.browseToolStripMenuItem.Text = "&Browse"; + this.browseToolStripMenuItem.Click += new System.EventHandler(this.LaunchBrowser); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(113, 6); + // + // ShowLogMenuItem + // + this.ShowLogMenuItem.Enabled = false; + this.ShowLogMenuItem.Name = "ShowLogMenuItem"; + this.ShowLogMenuItem.Size = new System.Drawing.Size(116, 22); + this.ShowLogMenuItem.Text = "&View Log"; + this.ShowLogMenuItem.Click += new System.EventHandler(this.ShowLog); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(113, 6); + // + // closeToolStripMenuItem + // + this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; + this.closeToolStripMenuItem.Size = new System.Drawing.Size(116, 22); + this.closeToolStripMenuItem.Text = "&Exit"; + this.closeToolStripMenuItem.Click += new System.EventHandler(this.ExitApp); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(116, 22); + this.helpToolStripMenuItem.Text = "&Help"; + this.helpToolStripMenuItem.Click += new System.EventHandler(this.ShowHelp); + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 370); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; + this.statusStrip1.Size = new System.Drawing.Size(343, 22); + this.statusStrip1.SizingGrip = false; + this.statusStrip1.TabIndex = 27; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(118, 17); + this.toolStripStatusLabel1.Text = "ASP.Net Version XXXXX"; + // + // ShowLogButton + // + this.ShowLogButton.Location = new System.Drawing.Point(176, 335); + this.ShowLogButton.Margin = new System.Windows.Forms.Padding(0); + this.ShowLogButton.Name = "ShowLogButton"; + this.ShowLogButton.Size = new System.Drawing.Size(75, 23); + this.ShowLogButton.TabIndex = 28; + this.ShowLogButton.Text = "Show &Log"; + this.ShowLogButton.Click += new System.EventHandler(this.ShowLog); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.optionsToolStripMenuItem, + this.helpToolStripMenuItem1}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(343, 24); + this.menuStrip1.TabIndex = 29; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.hideToolStripMenuItem, + this.toolStripSeparator4, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // hideToolStripMenuItem + // + this.hideToolStripMenuItem.Name = "hideToolStripMenuItem"; + this.hideToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.hideToolStripMenuItem.Text = "&Hide"; + this.hideToolStripMenuItem.Click += new System.EventHandler(this.HideMainForm); + // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(92, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(95, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.ExitApp); + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.nTLMAuthenticationRequiredToolStripMenuItem, + this.directoryBrowsingEnabledToolStripMenuItem}); + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20); + this.optionsToolStripMenuItem.Text = "&Options"; + // + // nTLMAuthenticationRequiredToolStripMenuItem + // + this.nTLMAuthenticationRequiredToolStripMenuItem.CheckOnClick = true; + this.nTLMAuthenticationRequiredToolStripMenuItem.Name = "nTLMAuthenticationRequiredToolStripMenuItem"; + this.nTLMAuthenticationRequiredToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.nTLMAuthenticationRequiredToolStripMenuItem.Text = "NTLM Authentication Required"; + this.nTLMAuthenticationRequiredToolStripMenuItem.ToolTipText = "When checked, require windows authentication via NTLM."; + // + // directoryBrowsingEnabledToolStripMenuItem + // + this.directoryBrowsingEnabledToolStripMenuItem.Checked = true; + this.directoryBrowsingEnabledToolStripMenuItem.CheckOnClick = true; + this.directoryBrowsingEnabledToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.directoryBrowsingEnabledToolStripMenuItem.Name = "directoryBrowsingEnabledToolStripMenuItem"; + this.directoryBrowsingEnabledToolStripMenuItem.Size = new System.Drawing.Size(219, 22); + this.directoryBrowsingEnabledToolStripMenuItem.Text = "Directory Browsing Enabled"; + this.directoryBrowsingEnabledToolStripMenuItem.ToolTipText = "When checked, if no default document is found display a directory listing."; + // + // helpToolStripMenuItem1 + // + this.helpToolStripMenuItem1.Name = "helpToolStripMenuItem1"; + this.helpToolStripMenuItem1.Size = new System.Drawing.Size(40, 20); + this.helpToolStripMenuItem1.Text = "&Help"; + this.helpToolStripMenuItem1.Click += new System.EventHandler(this.ShowHelp); + // + // TimeOutNumeric + // + this.TimeOutNumeric.Increment = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.TimeOutNumeric.Location = new System.Drawing.Point(95, 266); + this.TimeOutNumeric.Maximum = new decimal(new int[] { + 2000000000, + 0, + 0, + 0}); + this.TimeOutNumeric.Name = "TimeOutNumeric"; + this.TimeOutNumeric.Size = new System.Drawing.Size(66, 20); + this.TimeOutNumeric.TabIndex = 30; + // + // FormView + // + this.AcceptButton = this.ButtonStart; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(343, 392); + this.Controls.Add(this.menuStrip1); + this.Controls.Add(this.TimeOutNumeric); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.LabelIdleTimeOut); + this.Controls.Add(this.ApplicationPathTextBox); + this.Controls.Add(this.ShowLogButton); + this.Controls.Add(this.VirtualPathTextBox); + this.Controls.Add(this.HostNameTextBox); + this.Controls.Add(this.RootUrlLinkLabel); + this.Controls.Add(this.LabelPhysicalPath); + this.Controls.Add(this.LabelVPath); + this.Controls.Add(this.GroupBoxIPAddress); + this.Controls.Add(this.ButtonStart); + this.Controls.Add(this.AddHostEntryCheckBox); + this.Controls.Add(this.GroupBoxPort); + this.Controls.Add(this.ButtonBrowsePhysicalPath); + this.Controls.Add(this.LabelHostName); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormView"; + this.ShowInTaskbar = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "Cassini Developer Edition"; + this.WindowState = System.Windows.Forms.FormWindowState.Minimized; + this.GroupBoxPort.ResumeLayout(false); + this.GroupBoxPort.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.PortRangeEndTextBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PortRangeStartTextBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.PortTextBox)).EndInit(); + this.GroupBoxIPAddress.ResumeLayout(false); + this.GroupBoxIPAddress.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.errorProvider1)).EndInit(); + this.contextMenuStrip1.ResumeLayout(false); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.TimeOutNumeric)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.LinkLabel RootUrlLinkLabel; + private System.Windows.Forms.TextBox ApplicationPathTextBox; + private System.Windows.Forms.TextBox VirtualPathTextBox; + private System.Windows.Forms.TextBox HostNameTextBox; + private System.Windows.Forms.Label LabelPhysicalPath; + private System.Windows.Forms.CheckBox AddHostEntryCheckBox; + private System.Windows.Forms.Label LabelVPath; + private System.Windows.Forms.Button ButtonBrowsePhysicalPath; + private System.Windows.Forms.Label LabelHostName; + private System.Windows.Forms.GroupBox GroupBoxPort; + private System.Windows.Forms.Label LabelPortRangeSeperator; + private System.Windows.Forms.RadioButton PortModeFirstAvailableRadioButton; + private System.Windows.Forms.RadioButton PortModeSpecificRadioButton; + private System.Windows.Forms.GroupBox GroupBoxIPAddress; + private System.Windows.Forms.RadioButton RadioButtonIPSpecific; + private System.Windows.Forms.RadioButton IPModeAnyRadioButton; + private System.Windows.Forms.RadioButton IPModeLoopBackRadioButton; + private System.Windows.Forms.Button ButtonStart; + private System.Windows.Forms.CheckBox IPV6CheckBox; + private System.Windows.Forms.ErrorProvider errorProvider1; + private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.Label LabelIdleTimeOut; + internal System.Windows.Forms.NotifyIcon TrayIcon; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem showToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem browseToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem ShowLogMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.Button ShowLogButton; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem hideToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem nTLMAuthenticationRequiredToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem directoryBrowsingEnabledToolStripMenuItem; + private System.Windows.Forms.NumericUpDown TimeOutNumeric; + private System.Windows.Forms.NumericUpDown PortTextBox; + private System.Windows.Forms.NumericUpDown PortRangeStartTextBox; + private System.Windows.Forms.NumericUpDown PortRangeEndTextBox; + private System.Windows.Forms.ComboBox IPSpecificTextBox; + } +} \ No newline at end of file diff --git a/CassiniDev/Views/FormView.cs b/CassiniDev/Views/FormView.cs new file mode 100644 index 000000000..dbe0ea332 --- /dev/null +++ b/CassiniDev/Views/FormView.cs @@ -0,0 +1,834 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.htm file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Threading; +using System.Windows.Forms; +using CassiniDev.ServerLog; + +#endregion + +namespace CassiniDev +{ + public partial class FormView : Form + { + #region Fields + + private bool _automated; + + private LogView _logForm; + + private RunState _runState; + + private Server _server; + + #endregion + + #region Constructors + + public FormView(Server server) + { + _server = server; + InitializeComponent(); + InitializeUI(); + } + + #endregion + + #region Properties + + internal bool AddHost + { + get { return AddHostEntryCheckBox.Checked; } + set { AddHostEntryCheckBox.Checked = value; } + } + + internal string ApplicationPath + { + get { return ApplicationPathTextBox.Text; } + set { ApplicationPathTextBox.Text = value; } + } + + internal string HostName + { + get { return HostNameTextBox.Text; } + set { HostNameTextBox.Text = value; } + } + + internal string IPAddress + { + get { return IPSpecificTextBox.Text; } + set { IPSpecificTextBox.Text = value; } + } + + internal IPMode IPMode + { + get { return GetIpMode(); } + set { SetIpMode(value); } + } + + + internal bool NoDirList + { + get { return !directoryBrowsingEnabledToolStripMenuItem.Checked; } + set { directoryBrowsingEnabledToolStripMenuItem.Checked = !value; } + } + + internal bool NtmlAuthenticationRequired + { + get { return nTLMAuthenticationRequiredToolStripMenuItem.Checked; } + set { nTLMAuthenticationRequiredToolStripMenuItem.Checked = value; } + } + + internal int Port + { + get { return (int)PortTextBox.Value; } + set { PortTextBox.Value = value; } + } + + internal PortMode PortMode + { + get { return GetPortMode(); } + set { SetPortMode(value); } + } + + internal int PortRangeEnd + { + get { return (int)PortRangeEndTextBox.Value; } + set { PortRangeEndTextBox.Value = value; } + } + + internal int PortRangeStart + { + get { return (int)PortRangeStartTextBox.Value; } + set { PortRangeStartTextBox.Value = value; } + } + + internal string RootUrl + { + get { return RootUrlLinkLabel.Text; } + set + { + RootUrlLinkLabel.Text = value; + RootUrlLinkLabel.Visible = !string.IsNullOrEmpty(value); + } + } + + internal RunState RunState + { + get { return _runState; } + } + + internal int TimeOut + { + get { return (int)TimeOutNumeric.Value; } + set { TimeOutNumeric.Value = value; } + } + + internal bool V6 + { + get { return IPV6CheckBox.Checked; } + set { IPV6CheckBox.Checked = value; } + } + + internal string VirtualPath + { + get { return VirtualPathTextBox.Text; } + set { VirtualPathTextBox.Text = value; } + } + + #endregion + + #region Protected Methods + + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + + if (disposing && _server != null) + { + _server.Dispose(); + _server = null; + } + base.Dispose(disposing); + } + + /// + /// If the form is closing we need to determine whether to exit + /// or to minimize to tray. + /// + /// + protected override void OnClosing(CancelEventArgs e) + { + // if explicit closure or we are doing nothing then exit app. + if (RunState == RunState.Idle) + { + InvokeStop(); + } + else + { + WindowState = FormWindowState.Minimized; + e.Cancel = true; + } + } + + //protected override void OnShown(EventArgs e) + //{ + // if (_automated) + // { + // WindowState = FormWindowState.Minimized; + // Hide(); + // } + //} + + #endregion + + #region Private Methods + + + private void InitializeUI() + { + ButtonStart.Text = SR.GetString(SR.WebdevStart); + toolStripStatusLabel1.Text = SR.GetString(SR.WebdevAspNetVersion, Common.GetAspVersion()); + + + // if sqlite is missing then just silently enable in-memory logging, + // hide the enable logging item and enable view log item + + + + ShowLogButton.Enabled = false; + + + + toolStripStatusLabel1.Text = SR.GetString(SR.WebdevAspNetVersion, Common.GetAspVersion()); + + List localAddresses = new List(CassiniNetworkUtils.GetLocalAddresses()); + localAddresses.Insert(0, System.Net.IPAddress.IPv6Loopback); + localAddresses.Insert(0, System.Net.IPAddress.Loopback); + + IPSpecificTextBox.Items.AddRange(localAddresses.Select(i => i.ToString()).ToArray()); + if (IPSpecificTextBox.Items.Count > 0) + { + IPSpecificTextBox.SelectedIndex = 0; + IPSpecificTextBox.Text = IPSpecificTextBox.Items[0].ToString(); + } + + InvokeSetRunState(RunState.Idle); + if (_server == null) + { + ShowMainForm(); + } + else + { + _automated = true; + _server.TimedOut += OnTimedOut; + IPMode = IPMode.Specific; + PortMode = PortMode.Specific; + + UpdateUIFromServer(); + + + InvokeSetRunState(RunState.Running); + base.Text = SR.GetString(SR.WebdevNameWithPort, _server.Port); + TrayIcon.Visible = true; + DisplayTrayTip(); + } + } + + private void DisplayTrayTip() + { + + if (_server==null) + { + return; + } + TrayIcon.Text = _server.RootUrl; + string trayBaloonText = _server.RootUrl; + TrayIcon.ShowBalloonTip(5000, base.Text, trayBaloonText, ToolTipIcon.Info); + } + + private void UpdateUIFromServer() + { + base.Text = SR.GetString(SR.WebdevNameWithPort, _server.Port); + RootUrl = _server.RootUrl; + ApplicationPath = _server.PhysicalPath; + IPAddress = _server.IPAddress.ToString(); + Port = _server.Port; + HostName = _server.HostName; + NtmlAuthenticationRequired = _server.RequireAuthentication; + NoDirList = _server.DisableDirectoryListing; + TimeOut = _server.TimeoutInterval; + } + + protected override void OnResize(EventArgs e) + { + if (WindowState == FormWindowState.Minimized) + { + Hide(); + DisplayTrayTip(); + ShowInTaskbar = false; + } + base.OnResize(e); + } + + + private void ShowMainForm() + { + Show(); + WindowState = FormWindowState.Normal; + ShowInTaskbar = true; + + + //TrayIcon.Visible = false; + //ShowInTaskbar = true; + + //TopMost = true; + //Focus(); + //BringToFront(); + //TopMost = false; + } + + private void InvokeSetRunState(RunState state) + { + // use invoke, runstate may come from another thread. + if (InvokeRequired) + { + Invoke(new ParameterizedThreadStart(SetRunState), state); + } + else + { + SetRunState(state); + } + } + + /// + /// Sets RunState and enables/disables form fields accordingly + /// + /// + private void SetRunState(object state) + { + _runState = (RunState)state; + + switch (_runState) + { + case RunState.Idle: + if (!_automated) + { + EnableForm(); + } + // if not automated we are on our way out + break; + case RunState.Running: + DisableForm(); + break; + } + } + + + + + private void EnableForm() + { + ShowLogMenuItem.Enabled = ShowLogButton.Enabled = false; + base.Text = SR.GetString(SR.WebdevName); + ButtonStart.Text = "&Start"; + ButtonStart.Enabled = true; + nTLMAuthenticationRequiredToolStripMenuItem.Enabled = true; + directoryBrowsingEnabledToolStripMenuItem.Enabled = true; + ApplicationPathTextBox.Enabled = true; + ButtonBrowsePhysicalPath.Enabled = true; + VirtualPathTextBox.Enabled = true; + HostNameTextBox.Enabled = true; + GroupBoxIPAddress.Enabled = true; + GroupBoxPort.Enabled = true; + LabelHostName.Enabled = true; + LabelPhysicalPath.Enabled = true; + LabelVPath.Enabled = true; + TimeOutNumeric.Enabled = true; + RootUrl = null; + + AddHostEntryCheckBox.Enabled = !String.IsNullOrEmpty(HostName); + + switch (IPMode) + { + case IPMode.Loopback: + RadioButtonIPLoopBack_CheckedChanged(null, EventArgs.Empty); + break; + case IPMode.Any: + RadioButtonIPAny_CheckedChanged(null, EventArgs.Empty); + break; + case IPMode.Specific: + RadioButtonIPSpecific_CheckedChanged(null, EventArgs.Empty); + break; + } + + switch (PortMode) + { + case PortMode.FirstAvailable: + RadioButtonPortFind_CheckedChanged(null, EventArgs.Empty); + break; + case PortMode.Specific: + RadioButtonPortSpecific_CheckedChanged(null, EventArgs.Empty); + break; + } + + HostNameChanged(null, EventArgs.Empty); + } + + private void DisableForm() + { + ShowLogMenuItem.Enabled = ShowLogButton.Enabled = true; + + TimeOutNumeric.Enabled = false; + ButtonStart.Text = "&Stop"; + directoryBrowsingEnabledToolStripMenuItem.Enabled = false; + nTLMAuthenticationRequiredToolStripMenuItem.Enabled = false; + ApplicationPathTextBox.Enabled = false; + ButtonBrowsePhysicalPath.Enabled = false; + VirtualPathTextBox.Enabled = false; + HostNameTextBox.Enabled = false; + GroupBoxIPAddress.Enabled = false; + GroupBoxPort.Enabled = false; + AddHostEntryCheckBox.Enabled = false; + LabelHostName.Enabled = false; + LabelPhysicalPath.Enabled = false; + LabelVPath.Enabled = false; + } + + private void HostNameChanged() + { + if (string.IsNullOrEmpty(HostName)) + { + AddHostEntryCheckBox.Enabled = false; + AddHost = false; + } + else + { + AddHostEntryCheckBox.Enabled = true; + } + } + + + private void StartStop() + { + if (RunState != RunState.Running) + { + DisableForm(); + Start(); + } + else + { + InvokeStop(); + } + } + + private CommandLineArguments GetArgs() + { + CommandLineArguments args = new CommandLineArguments + { + AddHost = AddHost, + ApplicationPath = ApplicationPath, + HostName = HostName, + IPAddress = IPAddress, + IPMode = IPMode, + IPv6 = V6, + Port = Port, + PortMode = PortMode, + PortRangeEnd = PortRangeEnd, + PortRangeStart = PortRangeStart, + VirtualPath = VirtualPath, + TimeOut = TimeOut, + WaitForPort = 0, + Ntlm = NtmlAuthenticationRequired, + Nodirlist = NoDirList + }; + return args; + } + private void Start() + { + // use CommandLineArguments as a pre validation tool + + CommandLineArguments args = GetArgs(); + ClearError(); + + try + { + args.Validate(); + } + + catch (CassiniException ex) + { + SetError(ex.Field, ex.Message); + return; + } + + IPAddress = args.IPAddress; + + Port = args.Port; + + HostName = args.HostName; + + _server = new Server(args.Port, args.VirtualPath, args.ApplicationPath, + System.Net.IPAddress.Parse(args.IPAddress), args.HostName, args.TimeOut, args.Ntlm, + args.Nodirlist); + + if (args.AddHost) + { + HostsFile.AddHostEntry(_server.IPAddress.ToString(), _server.HostName); + } + + try + { + _server.Start(); + _server.TimedOut += OnTimedOut; + UpdateUIFromServer(); + InvokeSetRunState(RunState.Running); + + } + + catch (Exception ex) + { + SetError(ErrorField.None, ex.Message); + _server.Dispose(); + } + } + + /// + /// The server could be stopped either by user action, + /// timeout or exception. If by timeout, the call will be + /// coming from another thread in another appdomain far far + /// away, so we execise caution and wrap the method that + /// actual does the stoppage in this invokable wrapper. + /// + private void InvokeStop() + { + if (InvokeRequired) + { + Invoke(new MethodInvoker(Stop)); + } + else + { + Stop(); + } + } + + private void Stop() + { + // kill the start button so we don't get a start + // signal before completely stopped. + ButtonStart.Enabled = false; + + // revert the host file modification, if necessary + if (AddHost && RunState == RunState.Running) + { + HostsFile.RemoveHostEntry(_server.IPAddress.ToString(), _server.HostName); + } + + if (_server != null) + { + _server.TimedOut -= OnTimedOut; + _server.Dispose(); + } + + RootUrl = string.Empty; + + InvokeSetRunState(RunState.Idle); + + if (_automated) + { + ExitApp(); + } + } + + + + private static void ExitApp() + { + Application.Exit(); + } + + + private static void ShowHelp() + { + MessageBox.Show("help/about TODO"); + } + + private void ShowLog() + { + if (_logForm == null || _logForm.IsDisposed) + { + _logForm = new LogView(_server); + } + _logForm.Show(); + _logForm.BringToFront(); + } + + + private void BrowsePath() + { + FolderBrowserDialog fbd = new FolderBrowserDialog(); + + if (fbd.ShowDialog() == DialogResult.OK) + { + ApplicationPath = fbd.SelectedPath; + } + } + + private void LaunchBrowser() + { + Process.Start(RootUrlLinkLabel.Text); + } + + + private IPMode GetIpMode() + { + IPMode result; + if (IPModeAnyRadioButton.Checked) + { + result = IPMode.Any; + } + else if (IPModeLoopBackRadioButton.Checked) + { + result = IPMode.Loopback; + } + else + { + result = IPMode.Specific; + } + return result; + } + + private PortMode GetPortMode() + { + return PortModeSpecificRadioButton.Checked ? PortMode.Specific : PortMode.FirstAvailable; + } + + + + private void SetIpMode(IPMode value) + { + switch (value) + { + case IPMode.Loopback: + IPModeLoopBackRadioButton.Checked = true; + break; + case IPMode.Any: + IPModeAnyRadioButton.Checked = true; + break; + case IPMode.Specific: + RadioButtonIPSpecific.Checked = true; + break; + } + } + + private void SetPortMode(PortMode value) + { + switch (value) + { + case PortMode.FirstAvailable: + PortModeFirstAvailableRadioButton.Checked = true; + break; + case PortMode.Specific: + PortModeSpecificRadioButton.Checked = true; + break; + } + } + + + + private void SetError(ErrorField field, string value) + { + EnableForm(); + switch (field) + { + case ErrorField.ApplicationPath: + errorProvider1.SetError(ApplicationPathTextBox, value); + break; + case ErrorField.VirtualPath: + errorProvider1.SetError(VirtualPathTextBox, value); + break; + case ErrorField.HostName: + errorProvider1.SetError(HostNameTextBox, value); + break; + case ErrorField.IsAddHost: + errorProvider1.SetError(AddHostEntryCheckBox, value); + break; + case ErrorField.IPAddress: + errorProvider1.SetError(IPSpecificTextBox, value); + break; + case ErrorField.IPAddressAny: + errorProvider1.SetError(IPModeAnyRadioButton, value); + break; + case ErrorField.IPAddressLoopBack: + errorProvider1.SetError(IPModeLoopBackRadioButton, value); + break; + case ErrorField.Port: + errorProvider1.SetError(PortTextBox, value); + break; + case ErrorField.PortRange: + errorProvider1.SetError(PortRangeStartTextBox, value); + errorProvider1.SetError(PortRangeEndTextBox, value); + break; + case ErrorField.PortRangeStart: + errorProvider1.SetError(PortRangeStartTextBox, value); + break; + case ErrorField.PortRangeEnd: + errorProvider1.SetError(PortRangeEndTextBox, value); + break; + case ErrorField.None: + MessageBox.Show(value, "Error"); + break; + } + } + + private void ClearError() + { + errorProvider1.Clear(); + } + + + #endregion + + #region Handlers + + private void BrowsePath(object sender, EventArgs e) + { + BrowsePath(); + } + + private void HideMainForm(object sender, EventArgs e) + { + Close(); + } + + private void LaunchBrowser(object sender, EventArgs e) + { + LaunchBrowser(); + } + + private void LaunchBrowser(object sender, LinkLabelLinkClickedEventArgs e) + { + LaunchBrowser(); + } + + private void ShowHelp(object sender, EventArgs e) + { + ShowHelp(); + } + + private void ShowLog(object sender, EventArgs e) + { + ShowLog(); + } + + private void ShowMainForm(object sender, EventArgs e) + { + ShowMainForm(); + } + + /// + /// Responds to the Start/Stop button + /// + /// + /// + private void StartStop(object sender, EventArgs e) + { + StartStop(); + } + + + private void ExitApp(object sender, EventArgs e) + { + ExitApp(); + } + + private void HostNameChanged(object sender, EventArgs e) + { + HostNameChanged(); + } + + + /// + /// If a timeout value is specifically set and we + /// get a timeout event, just exit the application. + /// This should always be the case, but will be + /// a bit forgiving here and perform a check before + /// dumping. + /// + private void OnTimedOut(object sender, EventArgs e) + { + InvokeStop(); + + if (TimeOut > 0) + { + ExitApp(); + } + else + { + ShowMainForm(); + } + } + + #region Hinky lookin radios that depend on known state. Could be a source of trouble. + + private void RadioButtonIPAny_CheckedChanged(object sender, EventArgs e) + { + IPSpecificTextBox.Enabled = false; + IPV6CheckBox.Enabled = true; + } + + private void RadioButtonIPLoopBack_CheckedChanged(object sender, EventArgs e) + { + IPSpecificTextBox.Enabled = false; + IPV6CheckBox.Enabled = true; + } + + private void RadioButtonIPSpecific_CheckedChanged(object sender, EventArgs e) + { + IPSpecificTextBox.Enabled = true; + IPV6CheckBox.Enabled = false; + IPV6CheckBox.Checked = false; + } + + private void RadioButtonPortFind_CheckedChanged(object sender, EventArgs e) + { + PortTextBox.Enabled = false; + PortRangeEndTextBox.Enabled = true; + PortRangeStartTextBox.Enabled = true; + } + + private void RadioButtonPortSpecific_CheckedChanged(object sender, EventArgs e) + { + PortTextBox.Enabled = true; + PortRangeEndTextBox.Enabled = false; + PortRangeStartTextBox.Enabled = false; + } + #endregion + + #endregion + + + } +} \ No newline at end of file diff --git a/CassiniDev/Views/FormView.resx b/CassiniDev/Views/FormView.resx new file mode 100644 index 000000000..4e1ac2245 --- /dev/null +++ b/CassiniDev/Views/FormView.resx @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 147, 17 + + + The host name to use in place of 'localhost'. +This value must be a valid DNS host name or be present in the local hosts file. +You may check 'Add hosts entry' to add such an entry to the hosts file for the duration of the hosting session. +Adding a hosts entry requires elevated permissions, both upon adding and again upon removal. + + + You may check 'Add hosts entry' to add such an entry to the hosts file for the duration of the hosting session. +Adding a hosts entry requires elevated permissions, both upon adding and again upon removal. + + + The host name to use in place of 'localhost'. +This value must be a valid DNS host name or be present in the local hosts file. +You may check 'Add hosts entry' to add such an entry to the hosts file for the duration of the hosting session. +Adding a hosts entry requires elevated permissions, both upon adding and again upon removal. + + + + 17, 17 + + + 696, 17 + + + 586, 17 + + + + + AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA////AA+V+QDGiDAAj7euAHsfFQDsxn4ATuv/AKrZ/gC7iH8AAeL+AJpRSQBJqs4Az8jEAHO+ + /gC3w4gA1axVAPnqygCNTRkAIMXvAK+BVQCVvtkAPqH8APTZpwDXsp8A0en9AK5mKQBpx78A06Z7AKqi + kgBw3/4AqNXFAE/D/gC6wa4Ax5BjAIk1KwBiruMALJXkAAa4+ABDw9gAjs3/AKloXgDGm5MAcKu6AB3n + /wDu7+4A6s5iALbS5gDOlkUAfs7oAKSVYACzb0QAo4Z1AJpLMQCeucEA4bdtAIHBxgC4xdAA48i5ANy2 + iQAhqukAVcHLAL2lfwCzemsAvoRNADLM/QCpgTsA6MqYACmY+wDw370At5dwAF2z/gCoXj0Aqq6kAAjN + +QCPqaAAu3gvAMazlAC+4v8Au5pOANDBogCjVSQAkTodAGLZ/wCV3P4Au6WgAJLJogCqxaEA1KZqAHiz + 1wCgb1IAr6+UAGXo/wDFk30AycSHAHfN+wDUqYsAqcrYAES95QCF2f4AhSwfADjK5gCOxOYAyrV+ALGa + fAC7flkAosCzAGbH/wCRucAAFLf0AJNHPQDCztsAvIZtAF682ADawnUAsohkAKJcTwDH3/IA1KBQAMa7 + ogCZsKoAoWo+APfgrQC4u78A8tWaAMmSUQDLpJwAmEUhAI09MACSzN4A0Jk6AK5vWQCw1/IAy5huANW/ + lwDpwHMAzbBlABjL9ADbvKsAhsT0AKV6bgCod10Asod2ALavqQDqx4cA2K96AKRXLwDIjjwAwZGJAODE + ngCbXDkAunpDAOW+ewDAhmAAcNT/ALJuMgCe0/8AhsS5AKOoogAluecAosrBAALY/QB/xf4AYsPNAMOo + iwC3hVUAppmGADDD7QDgvJcADcD3AL6gdgCW2PQAiLfNAGzq/wC6s7QAorW3AKtlSgCaTkAAwoM3AKqD + ZAC4d04A26xaAM+bWwDHqoIAbLa7AMuchQCsZDMA055IALzNhQC0gS8AV8XZAJ5RKQD45b8AZbn+AKVh + KAC2cCsA16+UAK9xZQC03v8AtX1zALaRdwCdTSIAoFlFAKyPcQBMvOAAsXxDANCgcgDXrYMAkTwkAMGA + LgDMkTIA0KqiAKp2TgC0eGEArqCJAMfk/gB3ws8A0eLyAK14PADp0akAqWsuAMKHVwCtZT8AxoxFAKm8 + pwDitWIAot7+AKhkVgDHxcoAzZ93AMCviwDAjXcAn8G6AJRFNgChVDgAnWZGAATL+wA/xOMA16txAIEm + GgDOnmQAtnM8AMq3mgCxwaYAizMcACSS6AB62/0A5sugALJvTgCqXiUA9N2zAJy6ygCvvK4Alb/BAKpt + RAC4uqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAH2gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAABGoPIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhISEhLUavxz + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVHCwtyl2tzN/9ikyQAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+SGkx9zzuoO1jwd2J3FLRIfwAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAADQvxrD0e6oQxdDQ/fbUGL9qkyb3kgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI+pphc7u + 7jtDF/r6wPpDhnHM8kBMmxqS6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAB01WmXsrKTuzdDERHAehcXlTht + IUbRTMMaUX8AAAAAAAAAAAAAAAAAAAAAAAAAAOOS+cNMTNED0oK1wMAREXoX9+gm2E1Mw8PDGlHQ7wAA + AAAAAAAAAAAAAAAAAAAAsX/5GhrDw9ED0jf6F3p6ehER2yGpp3fNwxoaGvm/0O8AAAAAAAAAAAAAAAAA + AADpf1H5+ZvDTNEDtTeQF3p6ehcXRVATqehGwxr5+VFRyfQAAAAAAAAAAAAAAAAAACNSv1GS+RrDTNF2 + N+EGfBd8fHx8fIbt7L5Nm8P5UVHJyX9kAAAAAAAAAAAAAAAA7/R/v8lR+cPD0TDudgYGBgYGBoeHhzuj + 7In/pcMa+VHJf3/QZAAAAAAAAAAAAAAAZNB/v8lRGsPDspHSmJCQBgYGBoeHh5id7Eo4PsMa+VHJf1LQ + NQAAAAAAAAAAAADv0FJ/yVH5GsNMz5N2kAYGBgaHh4eHNzdX7KFlTdoa+flRf1JSymQAAAAAAAAAAABk + 9FJ/yVG6m5fOkwMwmJiYmIeHh4c3NxBeSgpK4EbcGvlRyX9S0AsFAAAAAAAAACNk9FJ/kroaQCLw0dED + dpiYmJiHhzc3tYJyEwqho+alGvlRyX9S9HRkAAAAAAAAAGRkUjWSUTObGhxM0dEDMJiYmJg3N7vS0tI3 + J6EKE+ZGl/lRyX9SUuluAAAAAAAAAO/QNX9/Ufn53UDDTNF2MLU3N7V2MjJCvQO1G6EK7ARGpbpRyX9S + 9PR0BQAAAAAAI2TpUlJ/UVH5hcPDTFh9AwOTA9KT82pniE8QVuwKoSe33GlRyX9/UoDK7wAAAAAA6dD0 + UlJ/UVGZ8ZtMfTvf0QMDAwMD5vUlKw8uvOwKoalbFBozyZJ/UsrKIwAAAAAAC+9SUlJ/UZKF+RrwO8+R + ttGTMAPRPiQWRAI8PUoKCuy4RlEzMzPef8qwgAAAAAAAse9SUn/JUTMz8c7PlRwc7rbR0dHRqllHR8Eg + QaEKCqGfPnm6mTMzSOqwbgAAAAAAbu/00H9/yXC6z92FOxzPzxzfst/wt6zBwcFrU60HLKEmS7O6tLTe + 3t5IbgAAAAAA6WT00FJ/yZkiz5eF5c7OzxwcHBwct2zBwcFrU1xcrVxBDGj+M7TeSEjq6QAAAAAAZLH0 + 0FJ/sN4iz92Z5eUcOxzOzs7Ot68ODg5rmh6trVweX9azM7TnSEjq6QAAAAAA78pSUlJS1ZLlzxzdYM+o + O87Ozs7Ot0kOog5fmh4eHh4eX6/IM5kYSEjq6QAAAAAAZGR09NB/cPhgzxwcqKioqKjOhYWF5VuioqKi + X/b2BGwxX2Zo1N6KSOrq6QAAAAAAZGSAyurKcGnEYBwcz6g7qKgchYUil2iLKKKiY2NjeEZGHTYNyN5w + SOrKIwAAAAAAZO/QPz/V1XDEYM8cHMTOHKioHCKbGkZmKCgoKGNj/XOS/nOKaUhI6up0ZAAAAAAAAO/j + xQkqg13ExGBgHBzOHDvPzt3xm3MVKCgoKFRUgcu/f3+/SEjq6uqxZAAAAAAAAG4/P8Uq57nExMTEYMTO + hYWFIiJAGnP7nJycnFRUq8uWf5KS6kjq6jUjAAAAAAAAACPHxz+UcBgYxMRgqKhghYWFIiKXl3OvnJyc + nJxUVKbrf97qf+rQNTUjAAAAAAAAAAApx8eUxT86isRgYGDEHIUzIiIiIqWenJycnJzi4p5af5I19PRk + NbEjAAAAAAAAAACACQkqxz/nijoYYGAchYWStJkimf5JCAgICAji4q+Nf+p/9PTv6W4AAAAAAAAAAAAA + KQmUlMc/XRiKOhi5XZLJ3pnektUdCAgICAgICGGzNUiw0NDpdAAAAAAAAAAAAAAAIwmUKgnHxxgYxIqK + ikh/f0i6yYNoCMbGxggIxoSzykjVg+Ox7wAAAAAAAAAAAAAAAG4qfgkJx7kYGMRgYBhd53Bpkr/IhMbG + xsbGxsY0jXBdyjUjAAAAAAAAAAAAAAAAAAB005QJCQkYGMRgYLmZ3rBd1dWkL05OTk5OxsaPjtXVdOkA + AAAAAAAAAAAAAAAAAAAAxX4qlJQqGBjEuefV6kg1f0hwOU5OTk5OTk57yIODsQAAAAAAAAAAAAAAAAAA + AAAAAMcqKpSUihgY510/4zU1SPhze9fX19fXTk5vyINuAAAAAAAAAAAAAAAAAAAAAAAAAAApKirTiooY + x8fF48o16rBdDa5v19fX19d1jm4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAbgkqKn7TCcfFxSnpsXR0xdU/ + jlXk2RkZjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCSp+KgnHP8UpKXR0dMp04z/njo4NLQAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvH036UCZTHx8fjdHTj48qAAAAALQAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAALHFCZSUlAkJKbGA7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD////n//8AAP///8f//wAA///4A/// + AAD//8AB//8AAP//AAA//wAA//wAAB//AAD/8AAAB/8AAP/gAAAD/wAA/8AAAAD/AAD/gAAAAH8AAP8A + AAAAfwAA/gAAAAA/AAD8AAAAAB8AAPwAAAAAHwAA+AAAAAAPAAD4AAAAAAcAAPAAAAAABwAA8AAAAAAH + AADwAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAA + AAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADwAAAAAAMAAPAAAAAABwAA8AAAAAAH + AAD4AAAAAAcAAPgAAAAADwAA/AAAAAAfAAD8AAAAAB8AAP4AAAAAPwAA/wAAAAB/AAD/gAAAAP8AAP/A + AAAB/wAA/+AAAAP/AAD/8AAAB/8AAP/8AAAH/wAA//8AAHf/AAD//+AB//8AAP///////wAA + + + + 346, 17 + + + 441, 17 + + + + AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA////AA+V+QDGiDAAj7euAHsfFQDsxn4ATuv/AKrZ/gC7iH8AAeL+AJpRSQBJqs4Az8jEAHO+ + /gC3w4gA1axVAPnqygCNTRkAIMXvAK+BVQCVvtkAPqH8APTZpwDXsp8A0en9AK5mKQBpx78A06Z7AKqi + kgBw3/4AqNXFAE/D/gC6wa4Ax5BjAIk1KwBiruMALJXkAAa4+ABDw9gAjs3/AKloXgDGm5MAcKu6AB3n + /wDu7+4A6s5iALbS5gDOlkUAfs7oAKSVYACzb0QAo4Z1AJpLMQCeucEA4bdtAIHBxgC4xdAA48i5ANy2 + iQAhqukAVcHLAL2lfwCzemsAvoRNADLM/QCpgTsA6MqYACmY+wDw370At5dwAF2z/gCoXj0Aqq6kAAjN + +QCPqaAAu3gvAMazlAC+4v8Au5pOANDBogCjVSQAkTodAGLZ/wCV3P4Au6WgAJLJogCqxaEA1KZqAHiz + 1wCgb1IAr6+UAGXo/wDFk30AycSHAHfN+wDUqYsAqcrYAES95QCF2f4AhSwfADjK5gCOxOYAyrV+ALGa + fAC7flkAosCzAGbH/wCRucAAFLf0AJNHPQDCztsAvIZtAF682ADawnUAsohkAKJcTwDH3/IA1KBQAMa7 + ogCZsKoAoWo+APfgrQC4u78A8tWaAMmSUQDLpJwAmEUhAI09MACSzN4A0Jk6AK5vWQCw1/IAy5huANW/ + lwDpwHMAzbBlABjL9ADbvKsAhsT0AKV6bgCod10Asod2ALavqQDqx4cA2K96AKRXLwDIjjwAwZGJAODE + ngCbXDkAunpDAOW+ewDAhmAAcNT/ALJuMgCe0/8AhsS5AKOoogAluecAosrBAALY/QB/xf4AYsPNAMOo + iwC3hVUAppmGADDD7QDgvJcADcD3AL6gdgCW2PQAiLfNAGzq/wC6s7QAorW3AKtlSgCaTkAAwoM3AKqD + ZAC4d04A26xaAM+bWwDHqoIAbLa7AMuchQCsZDMA055IALzNhQC0gS8AV8XZAJ5RKQD45b8AZbn+AKVh + KAC2cCsA16+UAK9xZQC03v8AtX1zALaRdwCdTSIAoFlFAKyPcQBMvOAAsXxDANCgcgDXrYMAkTwkAMGA + LgDMkTIA0KqiAKp2TgC0eGEArqCJAMfk/gB3ws8A0eLyAK14PADp0akAqWsuAMKHVwCtZT8AxoxFAKm8 + pwDitWIAot7+AKhkVgDHxcoAzZ93AMCviwDAjXcAn8G6AJRFNgChVDgAnWZGAATL+wA/xOMA16txAIEm + GgDOnmQAtnM8AMq3mgCxwaYAizMcACSS6AB62/0A5sugALJvTgCqXiUA9N2zAJy6ygCvvK4Alb/BAKpt + RAC4uqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAH2gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAABGoPIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhISEhLUavxz + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVHCwtyl2tzN/9ikyQAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+SGkx9zzuoO1jwd2J3FLRIfwAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAADQvxrD0e6oQxdDQ/fbUGL9qkyb3kgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI+pphc7u + 7jtDF/r6wPpDhnHM8kBMmxqS6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAB01WmXsrKTuzdDERHAehcXlTht + IUbRTMMaUX8AAAAAAAAAAAAAAAAAAAAAAAAAAOOS+cNMTNED0oK1wMAREXoX9+gm2E1Mw8PDGlHQ7wAA + AAAAAAAAAAAAAAAAAAAAsX/5GhrDw9ED0jf6F3p6ehER2yGpp3fNwxoaGvm/0O8AAAAAAAAAAAAAAAAA + AADpf1H5+ZvDTNEDtTeQF3p6ehcXRVATqehGwxr5+VFRyfQAAAAAAAAAAAAAAAAAACNSv1GS+RrDTNF2 + N+EGfBd8fHx8fIbt7L5Nm8P5UVHJyX9kAAAAAAAAAAAAAAAA7/R/v8lR+cPD0TDudgYGBgYGBoeHhzuj + 7In/pcMa+VHJf3/QZAAAAAAAAAAAAAAAZNB/v8lRGsPDspHSmJCQBgYGBoeHh5id7Eo4PsMa+VHJf1LQ + NQAAAAAAAAAAAADv0FJ/yVH5GsNMz5N2kAYGBgaHh4eHNzdX7KFlTdoa+flRf1JSymQAAAAAAAAAAABk + 9FJ/yVG6m5fOkwMwmJiYmIeHh4c3NxBeSgpK4EbcGvlRyX9S0AsFAAAAAAAAACNk9FJ/kroaQCLw0dED + dpiYmJiHhzc3tYJyEwqho+alGvlRyX9S9HRkAAAAAAAAAGRkUjWSUTObGhxM0dEDMJiYmJg3N7vS0tI3 + J6EKE+ZGl/lRyX9SUuluAAAAAAAAAO/QNX9/Ufn53UDDTNF2MLU3N7V2MjJCvQO1G6EK7ARGpbpRyX9S + 9PR0BQAAAAAAI2TpUlJ/UVH5hcPDTFh9AwOTA9KT82pniE8QVuwKoSe33GlRyX9/UoDK7wAAAAAA6dD0 + UlJ/UVGZ8ZtMfTvf0QMDAwMD5vUlKw8uvOwKoalbFBozyZJ/UsrKIwAAAAAAC+9SUlJ/UZKF+RrwO8+R + ttGTMAPRPiQWRAI8PUoKCuy4RlEzMzPef8qwgAAAAAAAse9SUn/JUTMz8c7PlRwc7rbR0dHRqllHR8Eg + QaEKCqGfPnm6mTMzSOqwbgAAAAAAbu/00H9/yXC6z92FOxzPzxzfst/wt6zBwcFrU60HLKEmS7O6tLTe + 3t5IbgAAAAAA6WT00FJ/yZkiz5eF5c7OzxwcHBwct2zBwcFrU1xcrVxBDGj+M7TeSEjq6QAAAAAAZLH0 + 0FJ/sN4iz92Z5eUcOxzOzs7Ot68ODg5rmh6trVweX9azM7TnSEjq6QAAAAAA78pSUlJS1ZLlzxzdYM+o + O87Ozs7Ot0kOog5fmh4eHh4eX6/IM5kYSEjq6QAAAAAAZGR09NB/cPhgzxwcqKioqKjOhYWF5VuioqKi + X/b2BGwxX2Zo1N6KSOrq6QAAAAAAZGSAyurKcGnEYBwcz6g7qKgchYUil2iLKKKiY2NjeEZGHTYNyN5w + SOrKIwAAAAAAZO/QPz/V1XDEYM8cHMTOHKioHCKbGkZmKCgoKGNj/XOS/nOKaUhI6up0ZAAAAAAAAO/j + xQkqg13ExGBgHBzOHDvPzt3xm3MVKCgoKFRUgcu/f3+/SEjq6uqxZAAAAAAAAG4/P8Uq57nExMTEYMTO + hYWFIiJAGnP7nJycnFRUq8uWf5KS6kjq6jUjAAAAAAAAACPHxz+UcBgYxMRgqKhghYWFIiKXl3OvnJyc + nJxUVKbrf97qf+rQNTUjAAAAAAAAAAApx8eUxT86isRgYGDEHIUzIiIiIqWenJycnJzi4p5af5I19PRk + NbEjAAAAAAAAAACACQkqxz/nijoYYGAchYWStJkimf5JCAgICAji4q+Nf+p/9PTv6W4AAAAAAAAAAAAA + KQmUlMc/XRiKOhi5XZLJ3pnektUdCAgICAgICGGzNUiw0NDpdAAAAAAAAAAAAAAAIwmUKgnHxxgYxIqK + ikh/f0i6yYNoCMbGxggIxoSzykjVg+Ox7wAAAAAAAAAAAAAAAG4qfgkJx7kYGMRgYBhd53Bpkr/IhMbG + xsbGxsY0jXBdyjUjAAAAAAAAAAAAAAAAAAB005QJCQkYGMRgYLmZ3rBd1dWkL05OTk5OxsaPjtXVdOkA + AAAAAAAAAAAAAAAAAAAAxX4qlJQqGBjEuefV6kg1f0hwOU5OTk5OTk57yIODsQAAAAAAAAAAAAAAAAAA + AAAAAMcqKpSUihgY510/4zU1SPhze9fX19fXTk5vyINuAAAAAAAAAAAAAAAAAAAAAAAAAAApKirTiooY + x8fF48o16rBdDa5v19fX19d1jm4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAbgkqKn7TCcfFxSnpsXR0xdU/ + jlXk2RkZjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCSp+KgnHP8UpKXR0dMp04z/njo4NLQAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvH036UCZTHx8fjdHTj48qAAAAALQAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAALHFCZSUlAkJKbGA7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD////n//8AAP///8f//wAA///4A/// + AAD//8AB//8AAP//AAA//wAA//wAAB//AAD/8AAAB/8AAP/gAAAD/wAA/8AAAAD/AAD/gAAAAH8AAP8A + AAAAfwAA/gAAAAA/AAD8AAAAAB8AAPwAAAAAHwAA+AAAAAAPAAD4AAAAAAcAAPAAAAAABwAA8AAAAAAH + AADwAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAA + AAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADwAAAAAAMAAPAAAAAABwAA8AAAAAAH + AAD4AAAAAAcAAPgAAAAADwAA/AAAAAAfAAD8AAAAAB8AAP4AAAAAPwAA/wAAAAB/AAD/gAAAAP8AAP/A + AAAB/wAA/+AAAAP/AAD/8AAAB/8AAP/8AAAH/wAA//8AAHf/AAD//+AB//8AAP///////wAA + + + \ No newline at end of file diff --git a/CassiniDev/Views/LogView.Designer.cs b/CassiniDev/Views/LogView.Designer.cs new file mode 100644 index 000000000..d509bab14 --- /dev/null +++ b/CassiniDev/Views/LogView.Designer.cs @@ -0,0 +1,356 @@ +namespace CassiniDev.ServerLog +{ + partial class LogView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogView)); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.scrollLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.listView1 = new System.Windows.Forms.ListView(); + this.TypeHeader = new System.Windows.Forms.ColumnHeader(); + this.CreatedHeader = new System.Windows.Forms.ColumnHeader(); + this.StatusHeader = new System.Windows.Forms.ColumnHeader(); + this.UrlHeader = new System.Windows.Forms.ColumnHeader(); + this.PathTranslatedHeader = new System.Windows.Forms.ColumnHeader(); + this.IdentityHeader = new System.Windows.Forms.ColumnHeader(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.headersRichTextBox = new System.Windows.Forms.RichTextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.exceptionRichTextBox = new System.Windows.Forms.RichTextBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.bodyBodyView = new CassiniDev.ServerLog.BodyView(); + this.menuStrip1.SuspendLayout(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.optionsToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(805, 24); + this.menuStrip1.TabIndex = 38; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.clearToolStripMenuItem, + this.toolStripSeparator1, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // clearToolStripMenuItem + // + this.clearToolStripMenuItem.Name = "clearToolStripMenuItem"; + this.clearToolStripMenuItem.Size = new System.Drawing.Size(99, 22); + this.clearToolStripMenuItem.Text = "&Clear"; + this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(96, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(99, 22); + this.exitToolStripMenuItem.Text = "E&xit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.scrollLogToolStripMenuItem}); + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20); + this.optionsToolStripMenuItem.Text = "&Options"; + // + // scrollLogToolStripMenuItem + // + this.scrollLogToolStripMenuItem.Checked = true; + this.scrollLogToolStripMenuItem.CheckOnClick = true; + this.scrollLogToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.scrollLogToolStripMenuItem.Name = "scrollLogToolStripMenuItem"; + this.scrollLogToolStripMenuItem.Size = new System.Drawing.Size(119, 22); + this.scrollLogToolStripMenuItem.Text = "&Scroll Log"; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 24); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.listView1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); + this.splitContainer1.Size = new System.Drawing.Size(805, 436); + this.splitContainer1.SplitterDistance = 196; + this.splitContainer1.TabIndex = 39; + // + // listView1 + // + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.TypeHeader, + this.CreatedHeader, + this.StatusHeader, + this.UrlHeader, + this.PathTranslatedHeader, + this.IdentityHeader}); + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.FullRowSelect = true; + this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listView1.HideSelection = false; + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.MultiSelect = false; + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(805, 196); + this.listView1.TabIndex = 0; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); + // + // TypeHeader + // + this.TypeHeader.Text = "Type"; + this.TypeHeader.Width = 80; + // + // CreatedHeader + // + this.CreatedHeader.Text = "Created"; + this.CreatedHeader.Width = 180; + // + // StatusHeader + // + this.StatusHeader.Text = "Status"; + // + // UrlHeader + // + this.UrlHeader.Text = "Url"; + this.UrlHeader.Width = 160; + // + // PathTranslatedHeader + // + this.PathTranslatedHeader.Text = "PathTranslated"; + this.PathTranslatedHeader.Width = 200; + // + // IdentityHeader + // + this.IdentityHeader.Text = "Identity"; + this.IdentityHeader.Width = 100; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.splitContainer3); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.groupBox3); + this.splitContainer2.Size = new System.Drawing.Size(805, 236); + this.splitContainer2.SplitterDistance = 289; + this.splitContainer2.TabIndex = 0; + // + // splitContainer3 + // + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.Location = new System.Drawing.Point(0, 0); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer3.Panel1 + // + this.splitContainer3.Panel1.Controls.Add(this.groupBox2); + // + // splitContainer3.Panel2 + // + this.splitContainer3.Panel2.Controls.Add(this.groupBox1); + this.splitContainer3.Size = new System.Drawing.Size(289, 236); + this.splitContainer3.SplitterDistance = 172; + this.splitContainer3.TabIndex = 0; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.headersRichTextBox); + this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox2.Location = new System.Drawing.Point(0, 0); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(289, 172); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Headers"; + // + // headersRichTextBox + // + this.headersRichTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.headersRichTextBox.Location = new System.Drawing.Point(3, 16); + this.headersRichTextBox.Name = "headersRichTextBox"; + this.headersRichTextBox.ReadOnly = true; + this.headersRichTextBox.Size = new System.Drawing.Size(283, 153); + this.headersRichTextBox.TabIndex = 45; + this.headersRichTextBox.Text = ""; + this.headersRichTextBox.WordWrap = false; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.exceptionRichTextBox); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(289, 60); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Exception - TODO"; + // + // exceptionRichTextBox + // + this.exceptionRichTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.exceptionRichTextBox.Location = new System.Drawing.Point(3, 16); + this.exceptionRichTextBox.Name = "exceptionRichTextBox"; + this.exceptionRichTextBox.ReadOnly = true; + this.exceptionRichTextBox.Size = new System.Drawing.Size(283, 41); + this.exceptionRichTextBox.TabIndex = 43; + this.exceptionRichTextBox.Text = "This field will contain full exception detail.\nNo more ambiguous HttpExceptions.\n" + + ""; + this.exceptionRichTextBox.WordWrap = false; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.bodyBodyView); + this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox3.Location = new System.Drawing.Point(0, 0); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(512, 236); + this.groupBox3.TabIndex = 0; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Body"; + // + // bodyBodyView + // + this.bodyBodyView.BackColor = System.Drawing.SystemColors.GradientActiveCaption; + this.bodyBodyView.Dock = System.Windows.Forms.DockStyle.Fill; + this.bodyBodyView.Location = new System.Drawing.Point(3, 16); + this.bodyBodyView.Name = "bodyBodyView"; + this.bodyBodyView.Size = new System.Drawing.Size(506, 217); + this.bodyBodyView.TabIndex = 41; + this.bodyBodyView.Value = null; + // + // LogView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Control; + this.ClientSize = new System.Drawing.Size(805, 460); + this.Controls.Add(this.splitContainer1); + this.Controls.Add(this.menuStrip1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "LogView"; + this.Text = "LogView"; + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + this.splitContainer2.ResumeLayout(false); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel2.ResumeLayout(false); + this.splitContainer3.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox3.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem scrollLogToolStripMenuItem; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.SplitContainer splitContainer3; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox3; + private BodyView bodyBodyView; + private System.Windows.Forms.RichTextBox exceptionRichTextBox; + private System.Windows.Forms.RichTextBox headersRichTextBox; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader TypeHeader; + private System.Windows.Forms.ColumnHeader CreatedHeader; + private System.Windows.Forms.ColumnHeader StatusHeader; + private System.Windows.Forms.ColumnHeader UrlHeader; + private System.Windows.Forms.ColumnHeader PathTranslatedHeader; + private System.Windows.Forms.ColumnHeader IdentityHeader; + } +} \ No newline at end of file diff --git a/CassiniDev/Views/LogView.cs b/CassiniDev/Views/LogView.cs new file mode 100644 index 000000000..650c844cf --- /dev/null +++ b/CassiniDev/Views/LogView.cs @@ -0,0 +1,137 @@ +// ********************************************************************************** +// CassiniDev - http://cassinidev.codeplex.com +// +// Copyright (c) Sky Sanders. All rights reserved. +// +// This source code is subject to terms and conditions of the Microsoft Public +// License (Ms-PL). A copy of the license can be found in the license.htm file +// included in this distribution. +// +// You must not remove this notice, or any other, from this software. +// +// ********************************************************************************** + +#region + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; + +#endregion + +namespace CassiniDev.ServerLog +{ + /// + /// If log can persist, then only stack values in the list and tag the items with the RowId for querying the db for heavy values. + /// If not, tag the item with the loginfo instance. Memory usage will be much greater but is better than nothing. + /// + public partial class LogView : Form + { + + + + private Server _server; + + public LogView(Server server) + { + InitializeComponent(); + _server = server; + _server.RequestComplete += RequestComplete; + + + InitializeList(); + + base.Text = SR.GetString(SR.WebdevLogViewerNameWithPort, _server.Port); + } + + /// + /// Not sure if these qualify for disposable + /// + /// + protected override void OnClosing(CancelEventArgs e) + { + _server.RequestComplete -= RequestComplete; + _server = null; + + } + + private void AddLogRows(IEnumerable items) + { + listView1.SuspendLayout(); + + foreach (LogInfo item in items) + { + ListViewItem a = new ListViewItem(new[] + { + item.RowType == 0 ? "" : item.RowType == 1 ? "Request" : "Response", + item.Created.ToString(), + item.StatusCode.ToString(), + item.Url, + item.PathTranslated, + item.Identity + }) + { + Tag = item + }; + listView1.Items.Add(a); + } + + if (listView1.Items.Count > 0 && scrollLogToolStripMenuItem.Checked) + { + int lastRow = listView1.Items.Count - 1; + listView1.EnsureVisible(lastRow); + } + listView1.ResumeLayout(); + } + + private void clearToolStripMenuItem_Click(object sender, EventArgs e) + { + InitializeList(); + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + private LogInfo GetSelectedLogItem() + { + object tag = listView1.Items[listView1.SelectedIndices[0]].Tag; + + LogInfo returnValue = (LogInfo)tag; + + return returnValue; + } + + private void InitializeList() + { + listView1.SuspendLayout(); + listView1.Items.Clear(); + listView1.ResumeLayout(); + } + + private void listView1_SelectedIndexChanged(object sender, EventArgs e) + { + if (listView1.SelectedIndices.Count > 0) + { + LogInfo log = GetSelectedLogItem(); + exceptionRichTextBox.Text = log.Exception; + headersRichTextBox.Text = log.Headers; + bodyBodyView.Value = log.Body; + } + else + { + exceptionRichTextBox.Text = ""; + headersRichTextBox.Text = ""; + bodyBodyView.Value = null; + } + } + + private void RequestComplete(object sender, RequestEventArgs e) + { + Invoke(new MethodInvoker(() => AddLogRows(new[] { e.RequestLog, e.ResponseLog }))); + } + + } +} \ No newline at end of file diff --git a/CassiniDev/Views/LogView.resx b/CassiniDev/Views/LogView.resx new file mode 100644 index 000000000..4b40ffd6b --- /dev/null +++ b/CassiniDev/Views/LogView.resx @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 175, 17 + + + 267, 17 + + + + + AAABAAEAMDAAAAAAAACoDgAAFgAAACgAAAAwAAAAYAAAAAEACAAAAAAAgAoAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA////AA+V+QDGiDAAj7euAHsfFQDsxn4ATuv/AKrZ/gC7iH8AAeL+AJpRSQBJqs4Az8jEAHO+ + /gC3w4gA1axVAPnqygCNTRkAIMXvAK+BVQCVvtkAPqH8APTZpwDXsp8A0en9AK5mKQBpx78A06Z7AKqi + kgBw3/4AqNXFAE/D/gC6wa4Ax5BjAIk1KwBiruMALJXkAAa4+ABDw9gAjs3/AKloXgDGm5MAcKu6AB3n + /wDu7+4A6s5iALbS5gDOlkUAfs7oAKSVYACzb0QAo4Z1AJpLMQCeucEA4bdtAIHBxgC4xdAA48i5ANy2 + iQAhqukAVcHLAL2lfwCzemsAvoRNADLM/QCpgTsA6MqYACmY+wDw370At5dwAF2z/gCoXj0Aqq6kAAjN + +QCPqaAAu3gvAMazlAC+4v8Au5pOANDBogCjVSQAkTodAGLZ/wCV3P4Au6WgAJLJogCqxaEA1KZqAHiz + 1wCgb1IAr6+UAGXo/wDFk30AycSHAHfN+wDUqYsAqcrYAES95QCF2f4AhSwfADjK5gCOxOYAyrV+ALGa + fAC7flkAosCzAGbH/wCRucAAFLf0AJNHPQDCztsAvIZtAF682ADawnUAsohkAKJcTwDH3/IA1KBQAMa7 + ogCZsKoAoWo+APfgrQC4u78A8tWaAMmSUQDLpJwAmEUhAI09MACSzN4A0Jk6AK5vWQCw1/IAy5huANW/ + lwDpwHMAzbBlABjL9ADbvKsAhsT0AKV6bgCod10Asod2ALavqQDqx4cA2K96AKRXLwDIjjwAwZGJAODE + ngCbXDkAunpDAOW+ewDAhmAAcNT/ALJuMgCe0/8AhsS5AKOoogAluecAosrBAALY/QB/xf4AYsPNAMOo + iwC3hVUAppmGADDD7QDgvJcADcD3AL6gdgCW2PQAiLfNAGzq/wC6s7QAorW3AKtlSgCaTkAAwoM3AKqD + ZAC4d04A26xaAM+bWwDHqoIAbLa7AMuchQCsZDMA055IALzNhQC0gS8AV8XZAJ5RKQD45b8AZbn+AKVh + KAC2cCsA16+UAK9xZQC03v8AtX1zALaRdwCdTSIAoFlFAKyPcQBMvOAAsXxDANCgcgDXrYMAkTwkAMGA + LgDMkTIA0KqiAKp2TgC0eGEArqCJAMfk/gB3ws8A0eLyAK14PADp0akAqWsuAMKHVwCtZT8AxoxFAKm8 + pwDitWIAot7+AKhkVgDHxcoAzZ93AMCviwDAjXcAn8G6AJRFNgChVDgAnWZGAATL+wA/xOMA16txAIEm + GgDOnmQAtnM8AMq3mgCxwaYAizMcACSS6AB62/0A5sugALJvTgCqXiUA9N2zAJy6ygCvvK4Alb/BAKpt + RAC4uqUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAH2gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAABGoPIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEhISEhLUavxz + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyVHCwtyl2tzN/9ikyQAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAH+SGkx9zzuoO1jwd2J3FLRIfwAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAADQvxrD0e6oQxdDQ/fbUGL9qkyb3kgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI+pphc7u + 7jtDF/r6wPpDhnHM8kBMmxqS6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAB01WmXsrKTuzdDERHAehcXlTht + IUbRTMMaUX8AAAAAAAAAAAAAAAAAAAAAAAAAAOOS+cNMTNED0oK1wMAREXoX9+gm2E1Mw8PDGlHQ7wAA + AAAAAAAAAAAAAAAAAAAAsX/5GhrDw9ED0jf6F3p6ehER2yGpp3fNwxoaGvm/0O8AAAAAAAAAAAAAAAAA + AADpf1H5+ZvDTNEDtTeQF3p6ehcXRVATqehGwxr5+VFRyfQAAAAAAAAAAAAAAAAAACNSv1GS+RrDTNF2 + N+EGfBd8fHx8fIbt7L5Nm8P5UVHJyX9kAAAAAAAAAAAAAAAA7/R/v8lR+cPD0TDudgYGBgYGBoeHhzuj + 7In/pcMa+VHJf3/QZAAAAAAAAAAAAAAAZNB/v8lRGsPDspHSmJCQBgYGBoeHh5id7Eo4PsMa+VHJf1LQ + NQAAAAAAAAAAAADv0FJ/yVH5GsNMz5N2kAYGBgaHh4eHNzdX7KFlTdoa+flRf1JSymQAAAAAAAAAAABk + 9FJ/yVG6m5fOkwMwmJiYmIeHh4c3NxBeSgpK4EbcGvlRyX9S0AsFAAAAAAAAACNk9FJ/kroaQCLw0dED + dpiYmJiHhzc3tYJyEwqho+alGvlRyX9S9HRkAAAAAAAAAGRkUjWSUTObGhxM0dEDMJiYmJg3N7vS0tI3 + J6EKE+ZGl/lRyX9SUuluAAAAAAAAAO/QNX9/Ufn53UDDTNF2MLU3N7V2MjJCvQO1G6EK7ARGpbpRyX9S + 9PR0BQAAAAAAI2TpUlJ/UVH5hcPDTFh9AwOTA9KT82pniE8QVuwKoSe33GlRyX9/UoDK7wAAAAAA6dD0 + UlJ/UVGZ8ZtMfTvf0QMDAwMD5vUlKw8uvOwKoalbFBozyZJ/UsrKIwAAAAAAC+9SUlJ/UZKF+RrwO8+R + ttGTMAPRPiQWRAI8PUoKCuy4RlEzMzPef8qwgAAAAAAAse9SUn/JUTMz8c7PlRwc7rbR0dHRqllHR8Eg + QaEKCqGfPnm6mTMzSOqwbgAAAAAAbu/00H9/yXC6z92FOxzPzxzfst/wt6zBwcFrU60HLKEmS7O6tLTe + 3t5IbgAAAAAA6WT00FJ/yZkiz5eF5c7OzxwcHBwct2zBwcFrU1xcrVxBDGj+M7TeSEjq6QAAAAAAZLH0 + 0FJ/sN4iz92Z5eUcOxzOzs7Ot68ODg5rmh6trVweX9azM7TnSEjq6QAAAAAA78pSUlJS1ZLlzxzdYM+o + O87Ozs7Ot0kOog5fmh4eHh4eX6/IM5kYSEjq6QAAAAAAZGR09NB/cPhgzxwcqKioqKjOhYWF5VuioqKi + X/b2BGwxX2Zo1N6KSOrq6QAAAAAAZGSAyurKcGnEYBwcz6g7qKgchYUil2iLKKKiY2NjeEZGHTYNyN5w + SOrKIwAAAAAAZO/QPz/V1XDEYM8cHMTOHKioHCKbGkZmKCgoKGNj/XOS/nOKaUhI6up0ZAAAAAAAAO/j + xQkqg13ExGBgHBzOHDvPzt3xm3MVKCgoKFRUgcu/f3+/SEjq6uqxZAAAAAAAAG4/P8Uq57nExMTEYMTO + hYWFIiJAGnP7nJycnFRUq8uWf5KS6kjq6jUjAAAAAAAAACPHxz+UcBgYxMRgqKhghYWFIiKXl3OvnJyc + nJxUVKbrf97qf+rQNTUjAAAAAAAAAAApx8eUxT86isRgYGDEHIUzIiIiIqWenJycnJzi4p5af5I19PRk + NbEjAAAAAAAAAACACQkqxz/nijoYYGAchYWStJkimf5JCAgICAji4q+Nf+p/9PTv6W4AAAAAAAAAAAAA + KQmUlMc/XRiKOhi5XZLJ3pnektUdCAgICAgICGGzNUiw0NDpdAAAAAAAAAAAAAAAIwmUKgnHxxgYxIqK + ikh/f0i6yYNoCMbGxggIxoSzykjVg+Ox7wAAAAAAAAAAAAAAAG4qfgkJx7kYGMRgYBhd53Bpkr/IhMbG + xsbGxsY0jXBdyjUjAAAAAAAAAAAAAAAAAAB005QJCQkYGMRgYLmZ3rBd1dWkL05OTk5OxsaPjtXVdOkA + AAAAAAAAAAAAAAAAAAAAxX4qlJQqGBjEuefV6kg1f0hwOU5OTk5OTk57yIODsQAAAAAAAAAAAAAAAAAA + AAAAAMcqKpSUihgY510/4zU1SPhze9fX19fXTk5vyINuAAAAAAAAAAAAAAAAAAAAAAAAAAApKirTiooY + x8fF48o16rBdDa5v19fX19d1jm4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAbgkqKn7TCcfFxSnpsXR0xdU/ + jlXk2RkZjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALCSp+KgnHP8UpKXR0dMp04z/njo4NLQAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvH036UCZTHx8fjdHTj48qAAAAALQAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAALHFCZSUlAkJKbGA7wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////AAD////n//8AAP///8f//wAA///4A/// + AAD//8AB//8AAP//AAA//wAA//wAAB//AAD/8AAAB/8AAP/gAAAD/wAA/8AAAAD/AAD/gAAAAH8AAP8A + AAAAfwAA/gAAAAA/AAD8AAAAAB8AAPwAAAAAHwAA+AAAAAAPAAD4AAAAAAcAAPAAAAAABwAA8AAAAAAH + AADwAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADgAAAAAAMAAOAA + AAAAAwAA4AAAAAADAADgAAAAAAMAAOAAAAAAAwAA4AAAAAADAADwAAAAAAMAAPAAAAAABwAA8AAAAAAH + AAD4AAAAAAcAAPgAAAAADwAA/AAAAAAfAAD8AAAAAB8AAP4AAAAAPwAA/wAAAAB/AAD/gAAAAP8AAP/A + AAAB/wAA/+AAAAP/AAD/8AAAB/8AAP/8AAAH/wAA//8AAHf/AAD//+AB//8AAP///////wAA + + + \ No newline at end of file diff --git a/CassiniDev/WebDev.WebServer40.exe.config b/CassiniDev/WebDev.WebServer40.exe.config new file mode 100644 index 000000000..600cf2303 --- /dev/null +++ b/CassiniDev/WebDev.WebServer40.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CassiniDev/app.config b/CassiniDev/app.config new file mode 100644 index 000000000..f34808b6b --- /dev/null +++ b/CassiniDev/app.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Content/Black/editor.png b/Content/Black/editor.png new file mode 100644 index 000000000..456f9c518 Binary files /dev/null and b/Content/Black/editor.png differ diff --git a/Content/Black/loading.gif b/Content/Black/loading.gif new file mode 100644 index 000000000..1079b7a96 Binary files /dev/null and b/Content/Black/loading.gif differ diff --git a/Content/Black/sprite.png b/Content/Black/sprite.png new file mode 100644 index 000000000..04441f514 Binary files /dev/null and b/Content/Black/sprite.png differ diff --git a/Content/Black/treeview-line.png b/Content/Black/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Black/treeview-line.png differ diff --git a/Content/Black/treeview-nodes.png b/Content/Black/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Black/treeview-nodes.png differ diff --git a/Content/Default/editor.png b/Content/Default/editor.png new file mode 100644 index 000000000..311414557 Binary files /dev/null and b/Content/Default/editor.png differ diff --git a/Content/Default/loading.gif b/Content/Default/loading.gif new file mode 100644 index 000000000..67065a630 Binary files /dev/null and b/Content/Default/loading.gif differ diff --git a/Content/Default/sprite.png b/Content/Default/sprite.png new file mode 100644 index 000000000..08709f1a6 Binary files /dev/null and b/Content/Default/sprite.png differ diff --git a/Content/Default/treeview-line.png b/Content/Default/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Default/treeview-line.png differ diff --git a/Content/Default/treeview-nodes.png b/Content/Default/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Default/treeview-nodes.png differ diff --git a/Content/Forest/editor.png b/Content/Forest/editor.png new file mode 100644 index 000000000..a4bf2d17e Binary files /dev/null and b/Content/Forest/editor.png differ diff --git a/Content/Forest/loading.gif b/Content/Forest/loading.gif new file mode 100644 index 000000000..b8453f0e9 Binary files /dev/null and b/Content/Forest/loading.gif differ diff --git a/Content/Forest/sprite.png b/Content/Forest/sprite.png new file mode 100644 index 000000000..87320dd78 Binary files /dev/null and b/Content/Forest/sprite.png differ diff --git a/Content/Forest/treeview-line.png b/Content/Forest/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Forest/treeview-line.png differ diff --git a/Content/Forest/treeview-nodes.png b/Content/Forest/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Forest/treeview-nodes.png differ diff --git a/Content/Hay/editor.png b/Content/Hay/editor.png new file mode 100644 index 000000000..0af0168e9 Binary files /dev/null and b/Content/Hay/editor.png differ diff --git a/Content/Hay/loading.gif b/Content/Hay/loading.gif new file mode 100644 index 000000000..f316fdcda Binary files /dev/null and b/Content/Hay/loading.gif differ diff --git a/Content/Hay/sprite.png b/Content/Hay/sprite.png new file mode 100644 index 000000000..541526baf Binary files /dev/null and b/Content/Hay/sprite.png differ diff --git a/Content/Hay/treeview-line.png b/Content/Hay/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Hay/treeview-line.png differ diff --git a/Content/Hay/treeview-nodes.png b/Content/Hay/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Hay/treeview-nodes.png differ diff --git a/Content/Images/img01.jpg b/Content/Images/img01.jpg new file mode 100644 index 000000000..9987db9f0 Binary files /dev/null and b/Content/Images/img01.jpg differ diff --git a/Content/Images/img02.jpg b/Content/Images/img02.jpg new file mode 100644 index 000000000..5200d6e17 Binary files /dev/null and b/Content/Images/img02.jpg differ diff --git a/Content/Images/img03.jpg b/Content/Images/img03.jpg new file mode 100644 index 000000000..6a8019fbd Binary files /dev/null and b/Content/Images/img03.jpg differ diff --git a/Content/Images/img04.jpg b/Content/Images/img04.jpg new file mode 100644 index 000000000..b62cf1358 Binary files /dev/null and b/Content/Images/img04.jpg differ diff --git a/Content/Images/img07.jpg b/Content/Images/img07.jpg new file mode 100644 index 000000000..64f983548 Binary files /dev/null and b/Content/Images/img07.jpg differ diff --git a/Content/Office2007/editor.png b/Content/Office2007/editor.png new file mode 100644 index 000000000..3bb258c4f Binary files /dev/null and b/Content/Office2007/editor.png differ diff --git a/Content/Office2007/loading.gif b/Content/Office2007/loading.gif new file mode 100644 index 000000000..daec89e00 Binary files /dev/null and b/Content/Office2007/loading.gif differ diff --git a/Content/Office2007/sprite.png b/Content/Office2007/sprite.png new file mode 100644 index 000000000..84dc74512 Binary files /dev/null and b/Content/Office2007/sprite.png differ diff --git a/Content/Office2007/treeview-line.png b/Content/Office2007/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Office2007/treeview-line.png differ diff --git a/Content/Office2007/treeview-nodes.png b/Content/Office2007/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Office2007/treeview-nodes.png differ diff --git a/Content/Outlook/editor.png b/Content/Outlook/editor.png new file mode 100644 index 000000000..2f88b4a47 Binary files /dev/null and b/Content/Outlook/editor.png differ diff --git a/Content/Outlook/loading.gif b/Content/Outlook/loading.gif new file mode 100644 index 000000000..daec89e00 Binary files /dev/null and b/Content/Outlook/loading.gif differ diff --git a/Content/Outlook/sprite.png b/Content/Outlook/sprite.png new file mode 100644 index 000000000..aca04751a Binary files /dev/null and b/Content/Outlook/sprite.png differ diff --git a/Content/Outlook/treeview-line.png b/Content/Outlook/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Outlook/treeview-line.png differ diff --git a/Content/Outlook/treeview-nodes.png b/Content/Outlook/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Outlook/treeview-nodes.png differ diff --git a/Content/Simple/editor.png b/Content/Simple/editor.png new file mode 100644 index 000000000..bea6d33a0 Binary files /dev/null and b/Content/Simple/editor.png differ diff --git a/Content/Simple/loading.gif b/Content/Simple/loading.gif new file mode 100644 index 000000000..daec89e00 Binary files /dev/null and b/Content/Simple/loading.gif differ diff --git a/Content/Simple/sprite.png b/Content/Simple/sprite.png new file mode 100644 index 000000000..5f7542779 Binary files /dev/null and b/Content/Simple/sprite.png differ diff --git a/Content/Simple/treeview-line.png b/Content/Simple/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Simple/treeview-line.png differ diff --git a/Content/Simple/treeview-nodes.png b/Content/Simple/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Simple/treeview-nodes.png differ diff --git a/Content/Sitefinity/editor.png b/Content/Sitefinity/editor.png new file mode 100644 index 000000000..57a0ca917 Binary files /dev/null and b/Content/Sitefinity/editor.png differ diff --git a/Content/Sitefinity/loading.gif b/Content/Sitefinity/loading.gif new file mode 100644 index 000000000..3c4d61eb1 Binary files /dev/null and b/Content/Sitefinity/loading.gif differ diff --git a/Content/Sitefinity/sprite.png b/Content/Sitefinity/sprite.png new file mode 100644 index 000000000..24a4b0f37 Binary files /dev/null and b/Content/Sitefinity/sprite.png differ diff --git a/Content/Sitefinity/treeview-line.png b/Content/Sitefinity/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Sitefinity/treeview-line.png differ diff --git a/Content/Sitefinity/treeview-nodes.png b/Content/Sitefinity/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Sitefinity/treeview-nodes.png differ diff --git a/Content/Sunset/editor.png b/Content/Sunset/editor.png new file mode 100644 index 000000000..3bdf9d607 Binary files /dev/null and b/Content/Sunset/editor.png differ diff --git a/Content/Sunset/loading.gif b/Content/Sunset/loading.gif new file mode 100644 index 000000000..f5c95b787 Binary files /dev/null and b/Content/Sunset/loading.gif differ diff --git a/Content/Sunset/sprite.png b/Content/Sunset/sprite.png new file mode 100644 index 000000000..9dfad945f Binary files /dev/null and b/Content/Sunset/sprite.png differ diff --git a/Content/Sunset/treeview-line.png b/Content/Sunset/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Sunset/treeview-line.png differ diff --git a/Content/Sunset/treeview-nodes.png b/Content/Sunset/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Sunset/treeview-nodes.png differ diff --git a/Content/Telerik/editor.png b/Content/Telerik/editor.png new file mode 100644 index 000000000..239e092e6 Binary files /dev/null and b/Content/Telerik/editor.png differ diff --git a/Content/Telerik/loading.gif b/Content/Telerik/loading.gif new file mode 100644 index 000000000..23580e300 Binary files /dev/null and b/Content/Telerik/loading.gif differ diff --git a/Content/Telerik/sprite.png b/Content/Telerik/sprite.png new file mode 100644 index 000000000..dfc6eeb52 Binary files /dev/null and b/Content/Telerik/sprite.png differ diff --git a/Content/Telerik/treeview-line.png b/Content/Telerik/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Telerik/treeview-line.png differ diff --git a/Content/Telerik/treeview-nodes.png b/Content/Telerik/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Telerik/treeview-nodes.png differ diff --git a/Content/Vista/editor.png b/Content/Vista/editor.png new file mode 100644 index 000000000..c66c631ff Binary files /dev/null and b/Content/Vista/editor.png differ diff --git a/Content/Vista/loading.gif b/Content/Vista/loading.gif new file mode 100644 index 000000000..0bf1b7d04 Binary files /dev/null and b/Content/Vista/loading.gif differ diff --git a/Content/Vista/sprite.png b/Content/Vista/sprite.png new file mode 100644 index 000000000..f5bd8ed51 Binary files /dev/null and b/Content/Vista/sprite.png differ diff --git a/Content/Web20/editor.png b/Content/Web20/editor.png new file mode 100644 index 000000000..23d13e030 Binary files /dev/null and b/Content/Web20/editor.png differ diff --git a/Content/Web20/loading.gif b/Content/Web20/loading.gif new file mode 100644 index 000000000..070505732 Binary files /dev/null and b/Content/Web20/loading.gif differ diff --git a/Content/Web20/sprite.png b/Content/Web20/sprite.png new file mode 100644 index 000000000..16129a769 Binary files /dev/null and b/Content/Web20/sprite.png differ diff --git a/Content/Web20/treeview-line.png b/Content/Web20/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/Web20/treeview-line.png differ diff --git a/Content/Web20/treeview-nodes.png b/Content/Web20/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/Web20/treeview-nodes.png differ diff --git a/Content/WebBlue/editor.png b/Content/WebBlue/editor.png new file mode 100644 index 000000000..fdc2239eb Binary files /dev/null and b/Content/WebBlue/editor.png differ diff --git a/Content/WebBlue/loading.gif b/Content/WebBlue/loading.gif new file mode 100644 index 000000000..9ed7d0c53 Binary files /dev/null and b/Content/WebBlue/loading.gif differ diff --git a/Content/WebBlue/sprite.png b/Content/WebBlue/sprite.png new file mode 100644 index 000000000..c144ae14b Binary files /dev/null and b/Content/WebBlue/sprite.png differ diff --git a/Content/WebBlue/treeview-line.png b/Content/WebBlue/treeview-line.png new file mode 100644 index 000000000..5b323892d Binary files /dev/null and b/Content/WebBlue/treeview-line.png differ diff --git a/Content/WebBlue/treeview-nodes.png b/Content/WebBlue/treeview-nodes.png new file mode 100644 index 000000000..f49805663 Binary files /dev/null and b/Content/WebBlue/treeview-nodes.png differ diff --git a/Content/Windows7/editor.png b/Content/Windows7/editor.png new file mode 100644 index 000000000..18f9f0dce Binary files /dev/null and b/Content/Windows7/editor.png differ diff --git a/Content/Windows7/loading.gif b/Content/Windows7/loading.gif new file mode 100644 index 000000000..c5463250e Binary files /dev/null and b/Content/Windows7/loading.gif differ diff --git a/Content/Windows7/sprite.png b/Content/Windows7/sprite.png new file mode 100644 index 000000000..27049258a Binary files /dev/null and b/Content/Windows7/sprite.png differ diff --git a/Content/style.css b/Content/style.css new file mode 100644 index 000000000..e72ec5155 --- /dev/null +++ b/Content/style.css @@ -0,0 +1,345 @@ + +/* +Design by Free CSS Templates +http://www.freecsstemplates.org +Released for free under a Creative Commons Attribution 2.5 License +*/ + +body { + margin: 20px 0px 0px 0px; + padding: 0; + background: #191919 url(images/img07.jpg) no-repeat right top; + font-family: Tahoma, Geneva, sans-serif; + font-size: 11px; + color: #3C3C3C; +} + +h1, h2, h3 { + margin: 0; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal; + color: #549900; +} + +h1 { + font-size: 44px; +} + +h2 { + font-size: 18px; +} + +h3 { +} + +p, ul, ol { + margin-top: 0; + line-height: 240%; + text-align: justify; +} + +ul, ol { +} + +blockquote { +} + +a { + color: #065EFE; +} + +a:hover { + text-decoration: none; +} + +a img { + border: none; +} + +img.left { + float: left; + margin: 7px 30px 0 0; +} + +img.right { + float: right; + margin: 7px 0 0 30px; +} + +hr { + display: none; +} + +.list1 { +} + +.list1 li { + float: left; + line-height: normal; +} + +.list1 li img { + margin: 0 30px 30px 0; +} + +.list1 li.alt img { + margin-right: 0; +} + +#wrapper { +} + +/* Header */ + +#header { + width: 950px; + height: 70px; + margin: 0px auto; +} + +/* Menu */ + +#menu { +} + +#menu ul { + margin: 0; + padding: 8px 0px 0px 0px; + list-style: none; + line-height: normal; +} + +#menu li { + display: block; + float: left; +} + +#menu a { + display: block; + float: left; + height: 28px; + padding: 7px 30px 0px 35px; + letter-spacing: -1px; + text-decoration: none; + text-align: center; + text-transform: lowercase; + font-family: Arial, Helvetica, sans-serif; + font-size: 17px; + font-weight: normal; + vertical-align:middle; + color: #FFFFFF; +} + +#menu a:hover { + text-decoration: none; +} + +#menu li.current_page_item { + background: url(images/img01.jpg) no-repeat left top; +} + +#menu li.current_page_item a { + background: url(images/img02.jpg) no-repeat right top; +} + +#menu .first { +} + +/* Search */ + +#search { + float: right; + padding: 10px 10px 0px 0px; +} + +#search form { + float: right; + margin: 0; + padding: 4px 0px 0 0; +} + +#search fieldset { + margin: 0; + padding: 0; + border: none; +} + +#search input { + float: left; + font: 12px Georgia, "Times New Roman", Times, serif; +} + +#search-text { + width: 213px; + height: 28px; + padding: 6px 0 0 7px; + border: none; + background: url(images/img02.jpg) no-repeat left top; + color: #000000; +} + +#search-submit { + width: 82px; + height: 28px; + margin-left: 10px; + padding: 0px 5px; + background: url(images/img03.jpg) no-repeat left top; + border: none; + text-indent: -9999px; + color: #FFFFFF; +} + +/* Page */ + +#page { + width: 930px; + margin: 0px auto; + padding: 10px 10px 10px 10px; + background: #E1E1E1; + overflow: hidden; +} + + + +/** LOGO */ + +#logo { + width: 950px; + height: 135px; + margin: 0 auto; + background: url(images/img03.jpg) no-repeat left top; +} + +#logo h1, #logo p { + margin: 0px; + line-height: normal; + text-transform: lowercase; + font-weight: normal; + color: #FFFFFF; +} + +#logo p { + margin-top: -4px; + padding: 0px 0px 0px 120px; + text-transform: lowercase; + font-family: Georgia, "Times New Roman", Times, serif; + font-size: 13px; + color: #3E81FB; +} + +#logo h1 { + padding: 30px 0px 0px 120px; + letter-spacing: -1px; + font-size: 48px; +} + +#logo h1 a { + text-decoration: none; + color: #FFFFFF; +} + +#logo a { + text-decoration: none; + color: #3E81FB; +} + +#banner { + padding-bottom: 20px; +} + +/* Content */ + +#content { + background: #FFFFFF no-repeat; + float: left; + width: 100%; + padding: 0px 0px 0px 0px; +} + +/* Post */ + +.post +{ + background: url(images/img04.jpg) no-repeat right top; + padding: 0px 30px 20px 30px; +} + +.post .title { + height: 44px; + margin: 0px; + padding: 36px 0px 0px 0px; + width: 576px; +} + +.post .title a { + letter-spacing: -2px; + text-decoration: none; + text-transform: lowercase; + font-size: 36px; + color: #424242; +} + +.post .title a:hover { + color: #065EFE; +} + +.post .meta { + margin-left: 2px; + padding: 4px 30px 2px 0px; + text-transform: uppercase; + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + font-size: 11px; + color: #66665E; +} + +.post .meta span { + margin: 0px; +} + +.post .meta a { + text-decoration: none; +} + +.post .entry { + padding: 10px 0px 0px 0px; +} + +.post .comments { + display: block; + width: 120px; + height: 18px; + margin: 0px; + padding: 3px 0px 0px 40px; + background: #90BF35; + border: 1px solid #5F817E; + text-decoration: none; + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; + text-decoration: none; + font-weight: bold; + color: #FFFFFF; +} + +/* Footer */ + +#footer { + width: 920px; + height: 100px; + margin: 0 auto; + padding: 0; +} + +#footer-bgcontent { +} + +#footer p { + margin: 0; + padding: 30px 0px 0px 0px; + text-align: center; + line-height: normal; + font-size: 11px; +} + +#footer a { +} diff --git a/Content/telerik.black.min.css b/Content/telerik.black.min.css new file mode 100644 index 000000000..16bc16a05 --- /dev/null +++ b/Content/telerik.black.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#080808;background-color:#4f4f4f;}.t-header,.t-grid-header{border-color:#080808;background:#050505 url('Black/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Black/sprite.png');}.t-editor .t-tool-icon{background-image:url('Black/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-32px -162px;}.t-numerictextbox .t-arrow-down{background-position:-32px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Black/loading.gif') no-repeat 0 0;}.t-widget,.t-link,.t-popup{color:#fff;}.t-other-month .t-link{color:#6f6f6f;}.t-group,.t-content,.t-editable-area{border-color:#080808;background-color:#4f4f4f;}.t-colorpicker .t-arrow-down{border-color:#080808;}.t-separator{border-color:#323232;background-color:#080808;}.t-alt{background-color:#494949;}.t-state-default{border-color:#080808;}.t-active-filter{background-color:#363636;}.t-state-hover{background-color:#2c2c2c;border-color:#080808;}.t-state-hover,.t-state-hover .t-link{color:#9eda29;}.t-state-active{background-color:#4f4f4f;border-color:#080808;}.t-state-selected{background:#1c1c1c;border-color:#000;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#787878;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#080808;background-color:#2c2c2c;}.t-button{background:#e8e8e8 url('Black/sprite.png') repeat-x 0 -96px;color:#fff;}.t-button-hover{background-position:0 -128px;color:#9eda29;}.t-tabstrip li.t-state-active{border-bottom-color:#4f4f4f;}.t-grid td{border-color:#454545;border-right:1px solid #454545;}.t-grouping-row td{background:#4f4f4f url('Black/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#666;}.t-grouping-dropclue{background:url('Black/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#4f4f4f;}.t-drag-clue{color:#fff;}.t-treeview .t-drop-clue{background-image:url('Black/sprite.png');background-position:0 -358px;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#000;}.t-panelbar .t-state-hover{background-image:none;}.t-filter-options,.t-menu .t-group{-moz-box-shadow:2px 2px 2px #333;-webkit-box-shadow:2px 2px 2px #333;box-shadow:2px 2px 2px #333;}.t-calendar th{background-color:#383838;border-color:#202020;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Black/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Black/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-window{-moz-box-shadow:0 0 5px 2px #222;-webkit-box-shadow:0 0 5px 2px #222;box-shadow:0 0 5px 2px #222;}.t-editor-button .t-state-hover{border-color:#565656 #111 #111 #565656;background-color:#232323;}.t-editor-button .t-state-active{border-color:#030303 #1f1f1f #1f1f1f #030303;background-color:#050505;} \ No newline at end of file diff --git a/Content/telerik.common.min.css b/Content/telerik.common.min.css new file mode 100644 index 000000000..779282d16 --- /dev/null +++ b/Content/telerik.common.min.css @@ -0,0 +1 @@ +.t-reset{margin:0;padding:0;border:0;outline:0;text-decoration:none;font-size:100%;list-style:none;}.t-widget,.t-widget button,.t-widget input,.t-widget select,.t-button{font-size:100%;}.t-widget{border-width:1px;border-style:solid;}.t-link{cursor:pointer;outline:none;}.t-button{display:block;cursor:pointer;text-decoration:none;outline:none;text-align:center;padding:2px 4px;line-height:18px;border-width:1px;border-style:solid;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}*+html .t-button{padding:1px 4px;}.t-icon,.t-editor-button .t-tool-icon{background-color:transparent;background-repeat:no-repeat;}.t-button .t-icon{vertical-align:top;margin-right:3px;margin-left:-6px;}.t-grid-rtl .t-button .t-icon{margin-left:3px;margin-right:-6px;}.t-header .t-link{text-decoration:none;}.t-state-disabled,.t-state-disabled .t-link{cursor:default;outline:none;}.t-icon,.t-sprite,.t-editor-button .t-tool-icon{display:inline-block;*display:inline;zoom:1;vertical-align:middle;width:16px;height:16px;overflow:hidden;font-size:0;line-height:0;text-indent:-9999px;}* html .t-icon,.t-sprite{text-indent:0;}*+html .t-icon,.t-sprite{text-indent:0;}.t-image{border:0;}.t-window{display:inline-block;*display:inline;zoom:1;z-index:10001;position:absolute;border-width:0;border-width:5px\9;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:0 0 5px 2px #aaa;-webkit-box-shadow:0 0 5px 2px #aaa;box-shadow:0 0 5px 2px #aaa;}.t-window-titlebar{padding:.4em 0;font-size:1.2em;line-height:1.2em;white-space:nowrap;border-bottom-width:1px;border-bottom-style:solid;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;border-top-left-radius:5px;border-top-right-radius:5px;}.t-window-title{cursor:default;position:absolute;text-overflow:ellipsis;overflow:hidden;left:.5em;right:.5em;}.t-window-title .t-image{margin:0 5px 0 0;vertical-align:middle;}.t-window-content{padding:.4em .5em;overflow:auto;-moz-border-radius-bottomleft:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-left-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-bottom-right-radius:4px;}.t-window-titlebar .t-window-actions{position:absolute;right:.5em;top:0;padding-top:.3em;white-space:nowrap;}.t-window-titlebar .t-window-action{width:16px;height:16px;padding:2px;text-decoration:none;vertical-align:middle;display:inline-block;*display:inline;zoom:1;opacity:.7;filter:alpha(opacity=70);}.t-window-titlebar .t-state-hover{border-width:1px;border-style:solid;padding:1px;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;opacity:1;filter:alpha(opacity=100);}.t-window-action .t-icon{margin:0;vertical-align:top;}.t-window .t-resize-handle{position:absolute;z-index:1;background-color:#fff;opacity:0;filter:alpha(opacity=0);zoom:1;line-height:6px;font-size:0;}.t-resize-n{top:-3px;left:0;width:100%;height:6px;cursor:n-resize;}.t-resize-e{top:0;right:-3px;width:6px;height:100%;cursor:e-resize;}.t-resize-s{bottom:-3px;left:0;width:100%;height:6px;cursor:s-resize;}.t-resize-w{top:0;left:-3px;width:6px;height:100%;cursor:w-resize;}.t-resize-se{bottom:-3px;right:-3px;width:16px;height:16px;cursor:se-resize;}.t-resize-sw{bottom:-3px;left:-3px;width:6px;height:6px;cursor:sw-resize;}.t-resize-ne{top:-3px;right:-3px;width:6px;height:6px;cursor:ne-resize;}.t-resize-nw{top:-3px;left:-3px;width:6px;height:6px;cursor:nw-resize;}.t-overlay{width:100%;height:100%;position:fixed;top:0;left:0;background-color:#000;filter:alpha(opacity=50);opacity:.5;z-index:10000;}.t-window .t-overlay{background-color:#fff;opacity:0;filter:alpha(opacity=0);position:absolute;width:100%;height:100%;}.t-window .t-widget{z-index:10002;}.t-tabstrip{margin:0;padding:0;zoom:1;}.t-tabstrip .t-tabstrip-items{padding:0 .3em;}.t-tabstrip .t-item,.t-panelbar .t-tabstrip .t-item{list-style-type:none;display:inline-block;*display:inline;zoom:1;border-width:1px;border-style:solid;margin:.1em .3em 0 0;position:relative;top:1px;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;border-top-left-radius:5px;border-top-right-radius:5px;}.t-tabstrip .t-link,.t-panelbar .t-tabstrip .t-link{padding:.3em .9em;display:inline-block;*display:inline;zoom:1;border-bottom-width:0;outline:0;}.t-tabstrip-items .t-icon,.t-panelbar .t-tabstrip-items .t-icon{margin:-1px 4px 0 -3px;vertical-align:top;}.t-tabstrip .t-item .t-image,.t-tabstrip .t-item .t-sprite,.t-panelbar .t-tabstrip .t-item .t-image,.t-panelbar .t-tabstrip .t-item .t-sprite{vertical-align:middle;margin:-3px 3px 0 -6px;}* html .t-tabstrip .t-item .t-image,* html .t-tabstrip .t-item .t-sprite{vertical-align:top;margin-top:-1px;}*+html .t-tabstrip .t-item .t-image,*+html .t-tabstrip .t-item .t-sprite{vertical-align:top;margin-top:-1px;}.t-tabstrip .t-content,.t-panelbar .t-tabstrip .t-content{border-width:1px;border-style:solid;margin:0 .3em .3em;padding:.3em 1em;display:none;position:static;zoom:1;}.t-tabstrip-rtl{direction:rtl;}.t-tabstrip-rtl .t-item,.t-panelbar .t-tabstrip-rtl .t-item{margin:.1em 0 0 .3em;}.t-tabstrip-rtl .t-item .t-icon,.t-panelbar .t-tabstrip-rtl .t-item .t-icon{margin:-1px -3px 0 4px;}.t-tabstrip-rtl .t-item .t-image,.t-tabstrip-rtl .t-item .t-sprite,.t-panelbar .t-tabstrip-rtl .t-item .t-image,.t-panelbar .t-tabstrip-rtl .t-item .t-sprite{margin:-4px -3px 0 3px;}.t-panelbar{zoom:1;}.t-panelbar .t-item{list-style-type:none;display:block;zoom:1;margin:0;top:0;border-width:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;}.t-panelbar .t-image,.t-panelbar .t-sprite{vertical-align:middle;margin-right:5px;margin-top:4px;float:left;}.t-panelbar .t-group .t-image,.t-panelbar .t-group .t-sprite{margin-top:1px;}.t-panelbar .t-link{line-height:2.05em;padding:0 1em;border-bottom:1px solid;display:block;position:relative;text-decoration:none;zoom:1;}.t-panelbar-expand,.t-panelbar-collapse{position:absolute;top:5px;right:2px;}.t-panelbar .t-group,.t-panelbar .t-content{position:relative;zoom:1;padding:0;margin:0;border-bottom-width:1px;border-bottom-style:solid;}.t-panelbar .t-group .t-link{line-height:1.7em;border-bottom:0;font-size:.95em;}.t-panelbar .t-group .t-arrow-up,.t-panelbar .t-group .t-arrow-down{top:2px;}.t-panelbar .t-group .t-group .t-link{padding-left:2em;}.t-panelbar .t-last .t-link{border-bottom:0;}.t-panelbar .t-group .t-group{border-bottom:0;}.t-panelbar-rtl{direction:rtl;}.t-panelbar-rtl .t-item{zoom:normal;}.t-panelbar-rtl .t-image,.t-panelbar-rtl .t-sprite{margin-right:0;margin-left:5px;float:right;}.t-panelbar-rtl .t-arrow-up,.t-panelbar-rtl .t-arrow-down{right:auto;left:2px;}.t-panelbar-rtl .t-group .t-group .t-link{padding-left:0;padding-right:2em;}.t-menu{cursor:default;}.t-menu,.t-menu .t-group{list-style:none;padding:0;margin:0;zoom:1;}.t-menu .t-group .t-link{padding-right:2em;}.t-menu .t-item{position:relative;display:inline-block;*display:inline;zoom:1;border-width:0 1px 0 0;border-style:solid;vertical-align:top;}.t-menu-vertical .t-item{display:block;border-width:0;}.t-menu .t-image,.t-menu .t-sprite{margin:0 4px 0 -4px;vertical-align:top;}.t-menu .t-link{text-decoration:none;padding:.25em .97em;display:block;}.t-menu .t-group{display:none;white-space:nowrap;border-style:solid;border-width:1px;overflow:visible;-moz-box-shadow:2px 2px 2px #aaa;-webkit-box-shadow:2px 2px 2px #aaa;box-shadow:2px 2px 2px #aaa;}.t-menu .t-group .t-item{display:block;border-width:0;}.t-menu .t-group .t-link{zoom:1;}.t-menu .t-arrow-down{margin-left:2px;margin-right:-10px;vertical-align:top;}.t-menu .t-arrow-next{position:absolute;right:0;top:3px;}.t-menu .t-animation-container,.t-menu .t-group{left:-1px;position:absolute;}.t-menu .t-animation-container .t-animation-container,.t-menu .t-group .t-group{left:100%;top:-1px;}.t-menu-vertical .t-animation-container,.t-menu-vertical .t-group{left:100%;top:-1px;}.t-menu .t-animation-container .t-group{left:auto;top:auto;}.t-menu-rtl{direction:rtl;}.t-menu-rtl .t-group .t-link{padding-left:2em;padding-right:.97em;}.t-menu-rtl .t-item{border-width:0 0 0 1px;}.t-menu-rtl .t-image,.t-menu-rtl .t-sprite{margin:0 -4px 0 4px;}.t-menu-rtl .t-arrow-down{margin-left:-10px;margin-right:2px;}.t-menu-rtl .t-arrow-next{right:auto;left:0;}.t-menu-rtl .t-animation-container,.t-menu-rtl .t-group{left:auto;right:-1px;}.t-menu-rtl .t-animation-container .t-animation-container,.t-menu-rtl .t-group .t-group{right:100%;left:auto;}.t-menu-vertical-rtl .t-animation-container,.t-menu-vertical-rtl .t-group{right:100%;left:auto;}.t-menu-rtl .t-animation-container .t-group{right:auto;}.t-grid{position:relative;zoom:1;}.t-grid table{width:100%;border-collapse:separate;empty-cells:show;border:0;}.t-grid-header .t-header{text-align:left;}.t-grid-header .t-header,.t-grid-header .t-last-header{padding:.3em .6em;border-width:0 1px 1px 0;border-style:solid;font-weight:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.t-grid-header .t-last-header{border-right-width:0;}.t-grid-header .t-header .t-link{line-height:18px;height:18px;display:block;margin:-.3em -.6em;padding:.3em 2.4em .3em .6em;border:0;}.t-grid-header .t-header .t-icon{position:static;}.t-grid .t-state-hover{cursor:pointer;}.t-grid td{padding:.25em .6em;border:0;vertical-align:middle;line-height:1.6em;overflow:hidden;text-overflow:ellipsis;}.t-grid .t-last{border-right-width:0;border-bottom-width:0;}.t-grid-header-wrap{position:relative;overflow:hidden;width:100%;zoom:1;}div.t-grid-header{padding-right:17px;zoom:1;border-bottom-width:1px;border-bottom-style:solid;}div.t-grid-header .t-header,div.t-grid-header .t-last-header{border-bottom-width:0;}div.t-grid-header .t-last-header{border-right-width:1px;}.t-grid-content{position:relative;overflow:auto;overflow-x:auto;overflow-y:scroll;width:100%;zoom:1;}.t-grid-header table,.t-grid-content table{table-layout:fixed;}* html .t-grid-content table{width:auto;}*+html .t-grid-content table{width:auto;}.t-grid .t-pager-wrapper,.t-grid-footer{border-style:solid;border-width:1px 0 0;}.t-grid div.t-pager-wrapper{border-width:0 0 1px 0;}.t-grid-footer div.t-pager-wrapper{border-width:0;}.t-grid div.t-grid-footer{border-width:1px 0 0;}.t-grid .t-pager-wrapper{padding:.2em .6em;line-height:1.8em;overflow:auto;}* html .t-pager-wrapper input{vertical-align:middle;}*+html .t-pager-wrapper input{vertical-align:middle;}.t-grid .t-pager,.t-grid .t-status,.t-grid .t-status-text,.t-pager .t-numeric,.t-pager .t-page-i-of-n,.t-pager .t-link,.t-pager span,.t-pager input,.t-grouping-row p{display:inline-block;*display:inline;zoom:1;vertical-align:middle;}.t-grid .t-status{float:left;margin:-.2em .6em -.2em -.6em;padding:.2em .6em;height:1.85em;border-right-width:1px;border-right-style:solid;}.t-grid .t-pager{float:left;cursor:default;}.t-grid .t-status-text{float:right;margin-right:.2em;}.t-pager .t-link{text-decoration:none;padding:1px;margin-top:.2em;border:0;line-height:16px;}.t-pager .t-state-active,.t-pager .t-state-hover{padding:0;border-width:1px;border-style:solid;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.t-pager span,.t-pager .t-link{vertical-align:top;}.t-pager .t-numeric,.t-pager .t-page-i-of-n{margin:0 7px;vertical-align:top;}.t-numeric .t-link,.t-numeric .t-state-active{margin-top:0;padding:0 5px;line-height:22px;vertical-align:top;}.t-numeric .t-state-active,.t-numeric .t-state-hover{padding:0 4px;line-height:20px;}.t-page-i-of-n input{width:2em;vertical-align:baseline;font-size:1em;}.t-pager-wrapper .t-status .t-icon{vertical-align:top;margin-top:3px;}.t-grid-filter{float:right;height:18px;padding:.3em .2em;position:relative;display:inline-block;*display:inline;zoom:1;margin:-1.8em -.6em -.3em 3px;margin-top:-.3em\9;}.t-link+.t-grid-filter{margin-top:-1.8em\9;}*+html .t-grid .t-grid-filter{margin-top:-1.8em;}.t-grid-filter .t-icon{vertical-align:top;}.t-grid .t-animation-container{position:absolute;}.t-filter-options{position:absolute;border-width:1px;border-style:solid;padding:3px;width:148px;-moz-box-shadow:2px 2px 2px #aaa;-webkit-box-shadow:2px 2px 2px #aaa;box-shadow:2px 2px 2px #aaa;}.t-filter-options .t-filter-help-text,.t-filter-options select,.t-filter-options input,.t-filter-options .t-button,.t-filter-options .t-datepicker{display:block;margin-bottom:4px;}.t-filter-options .t-button,.t-filter-options select{width:148px;}.t-filter-options input{width:142px;}.t-filter-options .t-datepicker .t-input{width:122px;margin:0;}.t-filter-options .t-filter-button{margin-bottom:0;}.t-grouping-row .t-icon{margin:0 4px;}.t-grouping-row p{padding:0 .6em;margin-left:-.6em;}.t-grid td.t-group-cell,.t-grid td.t-hierarchy-cell{border-right:0;}.t-grid .t-group-col,.t-grid .t-hierarchy-col{width:30px;}.t-drag-clue{border-width:1px;border-style:solid;font-size:.9em;padding:.05em .15em;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.t-grouping-header,.t-grouping-dropclue{height:24px;line-height:24px;}.t-grouping-dropclue{position:absolute;width:6px;}.t-grouping-header .t-group-indicator{display:inline-block;*display:inline;zoom:1;border-width:1px;border-style:solid;line-height:1.5em;padding:.15em .15em .15em .4em;margin:0 3px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.t-grouping-header .t-link{text-decoration:none;}.t-grouping-header .t-button{padding:0;border:0;background:transparent;}.t-grouping-header .t-icon{vertical-align:top;}.t-grouping-header .t-link .t-icon{margin:0 0 0 -3px;}.t-grouping-header .t-button .t-icon{margin:0 0 0 3px;}.t-grouping-header a,.t-grouping-header .t-button{display:inline-block;*display:inline;zoom:1;vertical-align:baseline;}.t-grouping-header,.t-grid-toolbar{cursor:default;margin:0;padding:.25em;border-bottom-width:1px;border-bottom-style:solid;}.t-grid .t-edit-container{padding:0;border-right:0;}.t-edit-form{padding:0;margin:0;}.t-edit-form td{border-top:0;border-bottom:0;}.t-edit-container .text-box,.t-edit-container .t-numerictextbox,.t-edit-container .t-datepicker{vertical-align:middle;width:5em;max-width:90%;min-width:90%;margin:-.4em -.3em -.15em;}* html .t-grid .text-box{width:90%;}.t-grid .field-validation-error{display:block;}.t-grid .input-validation-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-grid-toolbar .t-button,.t-grid-actions,.t-grid-action{display:inline-block;*display:inline;zoom:1;vertical-align:middle;font-size:1em;line-height:1.417em;}.t-grid-action,.t-grid-toolbar .t-button{margin:0 .2em;min-width:65px;}.t-grid-toolbar .t-button,button.t-grid-action,#ie8#fix{min-width:75px;}.t-detail-row{position:relative;}.t-grid-resize-indicator{position:absolute;width:2px;background-color:#aaa;}.t-grid .t-resize-handle{cursor:col-resize;position:absolute;height:25px;}.t-grid-rtl{direction:ltr;}.t-grid-rtl div.t-grid-header,.t-grid-rtl .t-grid-content,.t-grid-rtl .t-grid-footer,.t-grid-rtl .t-grouping-header,.t-grid-rtl .t-grid-toolbar,.t-grid-rtl .t-filter-options,.t-grid-rtl tbody{zoom:1;direction:rtl;}.t-grid-rtl table{border-collapse:separate;}.t-grid-rtl div.t-grid-header{padding-right:0\9;padding-left:17px\9;text-align:right;}.t-grid-rtl .t-header{text-align:right;border-width:0 0 1px 1px\9;}.t-grid-rtl .t-header .t-link{padding:.3em .6em .3em 2.4em;}.t-grid-rtl .t-grid-filter{float:left;margin:-1.8em 3px -.3em -.6em;}.t-grid-rtl .t-pager{direction:ltr;float:right;}.t-grid-rtl .t-status{float:right;border-right-width:0;border-left-style:solid;border-left-width:1px;margin:-.2em -.6em -.2em .6em;}.t-grid-rtl .t-status-text{float:left;}.t-grid-rtl .t-grouping-row p{margin-right:-0.6em;margin-left:0;padding-right:.6em;padding-left:0;}.t-autocomplete{background-position:100% 50%!important;}.t-combobox,.t-dropdown,.t-selectbox{display:inline-block;*display:inline;zoom:1;position:relative;overflow:hidden;white-space:nowrap;width:150px;border-width:0;}.t-dropdown-wrap{padding-right:16px;position:relative;border-width:1px;border-style:solid;display:block;cursor:default;}* html .t-combobox .t-dropdown-wrap{height:20px;}.t-combobox .t-input{font:inherit;vertical-align:top;border:0;width:100%;}.t-combobox .t-select{text-decoration:none;vertical-align:top;display:inline-block;*display:inline;zoom:1;cursor:default;position:absolute;top:0;right:0;border-width:0 0 0 1px;border-style:solid;border-color:inherit;}* html .t-combobox .t-select{top:1px;right:1px;}.t-combobox .t-icon{margin-top:1px;}.t-dropdown .t-select,.t-selectbox .t-select{border:0;text-decoration:none;font:inherit;color:inherit;overflow:hidden;cursor:default;}.t-dropdown .t-input,.t-selectbox .t-input{overflow:hidden;display:block;text-overflow:ellipsis;padding:.2em 0 .2em 3px;}.t-dropdown .t-icon,.t-combobox .t-select,.t-selectbox .t-icon{position:absolute;right:0;top:0;}.t-combobox .t-icon,.t-dropdown .t-icon,.t-selectbox .t-icon{vertical-align:top;margin-top:2px;}.t-combobox .t-input{height:18px;line-height:18px;padding:1px 3px;border:0;margin:0;}* html .t-combobox .t-input{padding:1px 0;}*+html .t-combobox .t-input{padding:1px 0;}.t-combobox .t-select,.t-dropdown .t-select,.t-selectbox .t-select{height:20px;line-height:20px;}.t-popup{border-width:1px;border-style:solid;}.t-popup .t-item{padding:1px 5px 1px 3px;cursor:default;}.t-calendar{display:inline-block;*display:inline;zoom:1;width:203px;position:relative;overflow:hidden;}.t-calendar .t-link{text-decoration:none;}.t-calendar .t-action-link{text-decoration:underline;}.t-calendar .t-header{padding:.4em 0;text-align:center;position:relative;zoom:1;}.t-calendar .t-nav-prev,.t-calendar .t-nav-next{position:absolute;top:.3em;}.t-calendar .t-nav-prev{left:1%;}.t-calendar .t-nav-next{right:1%;}.t-calendar .t-content{text-align:right;width:100%;height:169px;table-layout:fixed;}.t-calendar .t-animation-container .t-content{height:100%;}.t-calendar .t-nav-fast{display:inline-block;*display:inline;zoom:1;width:75%;}.t-calendar .t-nav-fast .t-icon{vertical-align:top;}.t-calendar th{border-bottom-style:solid;border-bottom-width:1px;font-weight:normal;cursor:default;}.t-calendar td{cursor:pointer;padding:1px;}.t-calendar .t-state-focus{border-width:1px;border-style:dotted;padding:0;}.t-calendar .t-content .t-link{display:block;overflow:hidden;position:relative;}.t-calendar th,.t-calendar .t-content .t-link{padding:.25em .45em .3em .1em;}.t-calendar .t-meta-view .t-link{padding:.25em 0 .3em;text-align:center;}.t-datepicker{border:0;white-space:nowrap;}div.t-datepicker{background-color:transparent;}.t-datepicker,.t-datepicker .t-input,.t-datepicker .t-icon-calendar{display:inline-block;*display:inline;zoom:1;vertical-align:top;}.t-datepicker .t-input{width:5.2em;margin:0;}.t-datepicker .t-icon-calendar{margin:3px 0 0 3px;}.t-datepicker-calendar{-moz-box-shadow:2px 2px 2px #aaa;-webkit-box-shadow:2px 2px 2px #aaa;box-shadow:2px 2px 2px #aaa;}div.t-treeview{border-width:0;background:none;white-space:nowrap;overflow:auto;}.t-treeview .t-item{padding:0 0 0 16px;margin:0;border-width:0;position:static;top:auto;display:block;}.t-treeview .t-group,.t-treeview .t-content{list-style-type:none;background:none;margin:0;padding:0;}.t-treeview .t-icon,.t-treeview .t-image,.t-treeview .t-in{display:inline-block;*display:inline;zoom:1;vertical-align:top;}.t-treeview .t-plus,.t-treeview .t-minus,.t-treeview .t-plus-disabled,.t-treeview .t-minus-disabled{margin-left:-16px;margin-top:2px;}.t-treeview .t-plus,.t-treeview .t-minus{cursor:pointer;}.t-treeview .t-plus-disabled,.t-treeview .t-minus-disabled{cursor:default;}.t-treeview .t-image{margin-right:3px;}.t-treeview .t-in{margin:1px 0;padding:2px 4px 2px 3px;text-decoration:none;line-height:16px;margin-left:2px;}.t-treeview span.t-in{cursor:default;}.t-treeview .t-state-hover,.t-treeview .t-state-selected{padding:1px 3px 1px 2px;border-width:1px;border-style:solid;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.t-treeview .t-drop-clue{width:80px;visibility:hidden;height:5px;position:absolute;margin-top:-3px;z-index:10000;background-color:transparent;background-repeat:no-repeat;}.t-treeview-lines .t-top{background-position:-91px 0;}.t-treeview-lines .t-bot{background-position:-69px -22px;}.t-treeview-lines .t-mid{background-position:-47px -44px;}.t-treeview-lines .t-last .t-top{background-position:-25px -66px;}.t-treeview-lines .t-last .t-bot{background-position:-69px -22px;}.t-treeview-lines .t-item{background-repeat:no-repeat;}.t-treeview-lines .t-first{background-repeat:no-repeat;background-position:0 16px;}div.t-numerictextbox{display:inline-block;*display:inline;zoom:1;vertical-align:middle;white-space:nowrap;border:0;background:transparent;}.t-numerictextbox .t-icon{margin-left:-16px;}.t-numerictextbox .t-arrow-up{vertical-align:top;margin-top:1px;height:10px;[hack:safari;margin-top:3px;];}*+html .t-numerictextbox .t-arrow-up{margin-top:1px;}.t-numerictextbox .t-arrow-down{vertical-align:bottom;margin-bottom:1px;height:11px;[hack:safari;margin-bottom:3px;];}*+html .t-numerictextbox .t-arrow-down{margin-bottom:1px;}.t-colorpicker{display:inline-block;*display:inline;zoom:1;vertical-align:middle;}.t-colorpicker .t-tool-icon{display:inline-block;*display:inline;zoom:1;vertical-align:top;padding:2px 3px;font-size:0;line-height:0;}.t-colorpicker .t-selected-color{display:block;height:16px;width:16px;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}.t-colorpicker .t-icon{vertical-align:middle;margin-top:2px;}.t-colorpicker-popup{line-height:0;width:136px;}.t-colorpicker-popup .t-reset{padding:.25em;margin:0;display:inline-block;*display:inline;zoom:1;}.t-colorpicker-popup .t-item{float:left;display:block;overflow:hidden;width:12px;height:12px;font-size:0;padding:0;margin:0 1px 1px 0;}.t-editor{border-width:1px;border-style:solid;border-collapse:separate;height:250px;font-size:100%;table-layout:fixed;vertical-align:top;width:100%;}.t-editor .t-editor-toolbar-wrap{border:0;padding:0;}.t-editor-toolbar{margin:0;padding:.1em 0;list-style-type:none;cursor:default;line-height:1.3em;}.t-editor-toolbar li{display:inline;vertical-align:middle;}.t-editor-toolbar .t-editor-dropdown,.t-editor-toolbar .t-editor-combobox,.t-editor-toolbar .t-editor-selectbox,.t-editor-toolbar .t-editor-colorpicker{margin-right:2px;}.t-editor-toolbar .t-separator{border-width:0 1px 0 0;border-style:solid;padding:0 0 0 1px;font-size:1.3em;margin:0 .15em;position:relative;top:1px;}.t-editor-toolbar .t-break{display:block;height:1px;line-height:0;font-size:0;}.t-editor-toolbar .t-dropdown,.t-editor-toolbar .t-combobox,.t-editor-toolbar .t-selectbox,.t-editor-toolbar .t-colorpicker{vertical-align:middle;}.t-editor-button .t-tool-icon{vertical-align:middle;width:22px;height:22px;margin:1px;}.t-editor-colorpicker .t-tool-icon{padding:17px 3px 2px;}.t-editor-colorpicker .t-icon{border-left:1px solid #ccc;}.t-editor-colorpicker .t-selected-color{height:3px;}.t-editor-combobox .t-input{height:20px;line-height:20px;}.t-editor-combobox .t-select{height:22px;line-height:22px;}.t-bold{background-position:-22px 0;}.t-italic{background-position:-44px 0;}.t-underline{background-position:-66px 0;}.t-strikethrough{background-position:-88px 0;}.t-justifyLeft{background-position:-110px 0;}.t-justifyCenter{background-position:-132px 0;}.t-justifyRight{background-position:-154px 0;}.t-justifyFull{background-position:-176px 0;}.t-insertOrderedList{background-position:-198px 0;}.t-insertUnorderedList{background-position:-220px 0;}.t-createLink{background-position:-242px 0;}.t-unlink{background-position:-264px 0;}.t-insertImage{background-position:-286px 0;}.t-foreColor .t-tool-icon{background-position:-308px -2px;}.t-backColor .t-tool-icon{background-position:-330px -2px;}.t-indent{background-position:-352px 0;}.t-outdent{background-position:-374px 0;}.t-fontName{width:110px;}.t-fontSize{width:124px;}.t-formatBlock{width:147px;}.t-editor-button .t-state-hover,.t-editor-button .t-state-active{vertical-align:middle;border-width:1px;border-style:solid;margin:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.t-editor-button .t-state-disabled{opacity:.3;filter:alpha(opacity=30);}.t-editor .t-editable-area{outline:none;height:100%;width:100%;border-width:1px;border-style:solid;}.t-editor .t-content{height:100%;width:100%;display:block;padding:0;margin:0;border:0;}.t-editor .t-raw-content{border:0;margin:0;padding:0;font:inherit;}.t-editor-dialog{padding:1em;}.t-editor-dialog ol{margin:0;padding:0;list-style:none;}.t-form-text-row,.t-form-checkbox-row{padding-bottom:1em;}.t-form-text-row label{display:inline-block;*display:inline;zoom:1;width:6em;text-align:right;padding-right:.5em;}.t-form-checkbox-row input{margin-left:6.5em;font-size:inherit;padding:0;}.t-form-checkbox-row label{padding-left:.3em;}.t-form-checkbox-row input,.t-form-checkbox-row label,.t-form-text-row label .t-form-text-row input,.t-form-text-row select{vertical-align:middle;}.t-form-text-row input,.t-form-text-row select{width:20em;}.t-editor-dialog .t-button-wrapper{padding-top:.5em;text-align:right;}.t-editor-dialog .t-button{display:inline-block;*display:inline;zoom:1;}.t-drag-clue{position:absolute;z-index:10000;padding:1px 3px 1px 2px;white-space:nowrap;cursor:default;}.t-drag-status{margin-right:4px;vertical-align:top;margin-top:-1px;} \ No newline at end of file diff --git a/Content/telerik.default.min.css b/Content/telerik.default.min.css new file mode 100644 index 000000000..6ee603b3f --- /dev/null +++ b/Content/telerik.default.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#989898;background-color:#fff;}.t-header,.t-grid-header{border-color:#989898;background:#adadad url('Default/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Default/sprite.png');}.t-editor .t-tool-icon{background-image:url('Default/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Default/loading.gif') no-repeat 0 0;}.t-widget,.t-link:link,.t-link:active,.t-link:visited,.t-popup{color:#000;}.t-group,.t-content,.t-editable-area{border-color:#828282;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#989898;}.t-separator{border-color:#d8d8d8;background-color:#999;}.t-alt{background-color:#f7f7f7;}.t-state-default{border-color:#828282;}.t-active-filter{background-color:#cdcdcd;}.t-state-hover{background-color:#e9e9e9;border-color:#828282;}.t-header .t-state-hover{background-color:#dcdada;}.t-state-active,.t-header .t-state-active{background-color:#fff;border-color:#828282;}.t-state-selected{background-color:#ddd;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#888;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#aaa;background-color:#eee;}.t-button{background:#e8e8e8 url('Default/sprite.png') repeat-x 0 -96px;color:#333;}.t-button-hover{background-position:0 -128px;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-color:#ddd;border-right:1px solid #eee;}.t-grouping-row td{background:#fff url('Default/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#ccc;}.t-grouping-dropclue{background:url('Default/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Default/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#838383;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#aaa;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#c5c5c5;}.t-other-month .t-link{color:#898989;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Default/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Default/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#e2e2e2 #878787 #878787 #e2e2e2;background-color:#c6c6c6;}.t-editor-button .t-state-active{border-color:#767676 #d0d0d0 #d0d0d0 #767676;background-color:#9e9e9e;} \ No newline at end of file diff --git a/Content/telerik.forest.min.css b/Content/telerik.forest.min.css new file mode 100644 index 000000000..b71d340d6 --- /dev/null +++ b/Content/telerik.forest.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#486b23;background-color:#d1deb6;}.t-header,.t-grid-header{border-color:#486b23;color:#fff;background:#4c7822 url('Forest/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Forest/sprite.png');}.t-editor .t-tool-icon{background-image:url('Forest/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Forest/loading.gif') no-repeat 0 0;}.t-widget,.t-link,.t-popup{color:#2b2c20;}.t-header,.t-header .t-link{color:#fff;}.t-content,.t-content .t-link,.t-group .t-link{color:#2b2c20;}.t-group,.t-content,.t-editable-area{border-color:#486b23;background-color:#d1deb6;}.t-colorpicker .t-arrow-down{border-color:#486b23;}.t-separator{border-color:#719652;background-color:#4c6d3b;}.t-alt{background-color:#c7d6a7;}.t-state-default{border-color:#486b23;}.t-active-filter{background-color:#60963e;}.t-state-hover{background-color:#6c9f4f;border-color:#486b23;}.t-panelbar .t-state-hover,.t-panelbar .t-state-selected{background-image:url('Forest/sprite.png');background-repeat:repeat-x;background-position:0 0;}.t-tabstrip .t-state-hover,.t-panelbar .t-group .t-state-hover,.t-panelbar .t-group .t-state-selected{background-image:none;}.t-state-selected,.t-state-selected .t-state-hover{background-color:#3a5621;border-color:#486b23;}.t-state-active{background-color:#d1deb6;border-color:#486b23;}.t-state-hover,.t-state-hover .t-link,.t-state-selected,.t-state-selected .t-link{color:#fff;}.t-tabstrip .t-state-active .t-link{color:#2b2c20;}.t-group .t-state-hover,.t-group .t-state-selected{color:#fff;background-image:none;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#606060;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#486b23;background-color:#a7bc75;}.t-button{background:#e8e8e8 url('Forest/sprite.png') repeat-x 0 -96px;color:#fff;}.t-button-hover{background-position:0 -128px;}.t-tabstrip li.t-state-active{border-bottom-color:#d1deb6;}.t-editor-button .t-state-active{background-color:#527c30;}.t-grid td{border-color:#bdcb9e;border-right:1px solid #bdcb9e;}.t-grouping-row td{background:#d1deb6 url('Forest/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#486B23;}.t-grouping-dropclue{background:url('Forest/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#d1deb6;}.t-treeview .t-drop-clue{background-image:url('Forest/sprite.png');background-position:0 -358px;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#486b23;}.t-calendar th{background-color:#a6bb74;border-color:#9cb16a;}.t-other-month .t-link{color:#88914b;}.t-state-hover .t-link{color:#fff;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Forest/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Forest/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-window{-moz-box-shadow:0 0 5px 2px #6f855a;-webkit-box-shadow:0 0 5px 2px #6f855a;box-shadow:0 0 5px 2px #6f855a;}.t-editor-button .t-state-hover{border-color:#88ab72 #416926 #416926 #88ab72;background-color:#548231;}.t-editor-button .t-state-active{border-color:#2a4b17 #7f9c6d #7f9c6d #2a4b17;background-color:#446e29;} \ No newline at end of file diff --git a/Content/telerik.hay.min.css b/Content/telerik.hay.min.css new file mode 100644 index 000000000..67a84c7af --- /dev/null +++ b/Content/telerik.hay.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#7d7c6f;background-color:#ececd8;}.t-header,.t-grid-header{border-color:#378909;background:#4eb106 url('Hay/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Hay/sprite.png');}.t-editor .t-tool-icon{background-image:url('Hay/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-header .t-arrow-up,.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-header .t-arrow-down,.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-header .t-arrow-first,.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-header .t-arrow-prev,.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-header .t-arrow-next,.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-header .t-arrow-last,.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Hay/loading.gif') no-repeat 0 0;}.t-widget,.t-link,.t-popup{color:#333;}.t-header,.t-header .t-link{color:#fff;}.t-header .t-group,.t-group .t-link{color:#333;}.t-group,.t-content,.t-editable-area{border-color:#bbb99d;background-color:#ececd8;}.t-colorpicker .t-arrow-down{border-color:#378909;}.t-separator{border-color:#73c335;background-color:#378909;}.t-alt{background-color:#fff;}.t-state-default{border-color:#378909;}.t-active-filter{background-color:#51b200;}.t-state-hover{background-color:#6cc41a;border-color:#378909;}.t-state-hover,.t-state-hover .t-link,.t-group .t-state-hover{color:#fff;}.t-state-active{background-color:#ececd8;border-color:#378909;}.t-state-active,.t-state-active .t-link{color:#333;}.t-state-active .t-header,.t-state-active .t-state-hover{color:#fff;}.t-state-selected{background:#4e8e13;}.t-state-selected,.t-state-selected .t-header,.t-state-selected .t-state-hover,.t-state-selected .t-link{color:#fff;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#666;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#bbb99d;background-color:#dee0c8;}.t-button{background:#e8e8e8 url('Hay/sprite.png') repeat-x 0 -96px;color:#333;border-color:#898772;}.t-button-hover{background-position:0 -128px;}.t-panelbar .t-link{border-color:#333;}.t-tabstrip li.t-state-active{border-bottom-color:#ececd8;}.t-grid td{border-color:#ddd;border-right:1px solid #eee;}.t-grouping-row td{background:#fff url('Hay/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#aaa;}.t-grouping-dropclue{background:url('Hay/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Hay/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#2C8406;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#cac8ab;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Hay/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Hay/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#73cd26 #38910a #38910a #73cd26;background-color:#63c215;}.t-editor-button .t-state-active{border-color:#257802 #60ba1d #60ba1d #257802;background-color:#47a605;} \ No newline at end of file diff --git a/Content/telerik.office2007.min.css b/Content/telerik.office2007.min.css new file mode 100644 index 000000000..c690bfc6d --- /dev/null +++ b/Content/telerik.office2007.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#688caf;background-color:#fff;}.t-header,.t-grid-header{border-color:#688caf;background:#c3d8f1 url('Office2007/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Office2007/sprite.png');}.t-editor .t-tool-icon{background-image:url('Office2007/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Office2007/loading.gif') no-repeat 0 0;}.t-widget,.t-link:link,.t-link:active,.t-link:visited,.t-popup{color:#000;}.t-group,.t-content,.t-editable-area{border-color:#688caf;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#688caf;}.t-separator{border-color:#ebf1f9;background-color:#a0b2c7;}.t-alt{background-color:#fff;}.t-state-default{border-color:#688caf;}.t-active-filter{background-color:#c0d9ef;}.t-state-hover{background-color:#d6e5f3;border-color:#688caf;}.t-state-active{background-color:#fff;border-color:#688caf;}.t-state-selected{background-color:#ffd176;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#8d8d8d;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#5d8cc9;background-color:#d6e5f3;}.t-button{background:#e8e8e8 url('Office2007/sprite.png') repeat-x 0 -96px;color:#333;}.t-button-hover{background-position:0 -128px;border-color:#d8ca95 #b9a073 #c6b99c;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-color:#ddd;border-right:1px solid #d6e5f3;}.t-grouping-row td{background:#fff url('Office2007/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#aaa;}.t-grouping-dropclue{background:url('Office2007/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Office2007/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#a79d87;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#5d8cc9;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#9ebfdb;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Office2007/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Office2007/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#e8f0fa #98b2d0 #98b2d0 #e8f0fa;background-color:#d4e3f5;}.t-editor-button .t-state-active{border-color:#88a4c5 #d0dcea #d0dcea #88a4c5;background-color:#9fbad9;} \ No newline at end of file diff --git a/Content/telerik.outlook.min.css b/Content/telerik.outlook.min.css new file mode 100644 index 000000000..742a0543a --- /dev/null +++ b/Content/telerik.outlook.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#5d8cc9;background-color:#fff;}.t-header,.t-grid-header{border-color:#5d8cc9;background:#7da5e0 url('Outlook/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Outlook/sprite.png');}.t-editor .t-tool-icon{background-image:url('Outlook/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Outlook/loading.gif') no-repeat 0 0;}.t-widget,.t-link:link,.t-link:active,.t-link:visited,.t-popup{color:#000;}.t-group,.t-content,.t-editable-area{border-color:#5d8cc9;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#5d8cc9;}.t-separator{border-color:#cfdef4;background-color:#7e98bc;}.t-alt{background-color:#f7f7f7;}.t-state-default{border-color:#5d8cc9;}.t-active-filter{background-color:#b6cef2;}.t-state-hover{background-color:#d6e5f3;border-color:#5d8cc9;}.t-state-active{background-color:#fff;border-color:#5d8cc9;}.t-state-selected{background-color:#bcd3f3;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#666;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#5d8cc9;background-color:#d6e5f3;}.t-button{background:#e8e8e8 url('Outlook/sprite.png') repeat-x 0 -96px;color:#333;}.t-button-hover{background-position:0 -128px;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-color:#ddd;border-right:1px solid #eee;}.t-grouping-row td{background:#fff url('Outlook/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#aaa;}.t-grouping-dropclue{background:url('Outlook/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Outlook/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#002d96;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#5d8cc9;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#89aee5;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Outlook/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Outlook/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#dae8fa #668dcf #668dcf #dae8fa;background-color:#93b5e7;}.t-editor-button .t-state-active{border-color:#5781c9 #a3c1ea #a3c1ea #5781c9;background-color:#7da5e0;} \ No newline at end of file diff --git a/Content/telerik.simple.min.css b/Content/telerik.simple.min.css new file mode 100644 index 000000000..f2983593f --- /dev/null +++ b/Content/telerik.simple.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#828282;background-color:#fff;}.t-header,.t-grid-header{border-color:#828282;background:#e6e6e6;}.t-icon{background-image:url('Simple/sprite.png');}.t-editor .t-tool-icon{background-image:url('Simple/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Simple/loading.gif') no-repeat 0 0;}.t-widget,.t-link:link,.t-link:active,.t-link:visited,.t-popup{color:#000;}.t-group,.t-content,.t-editable-area{border-color:#828282;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#828282;}.t-separator{border-color:#fff;background-color:#999;}.t-alt{background-color:#f7f7f7;}.t-state-default{border-color:#828282;}.t-active-filter{background-color:#d8d8d8;}.t-state-hover{background-color:#ffe79c;border-color:#c98400;}.t-state-active{background-color:#fff;border-color:#828282;}.t-state-selected{background-color:#ffa517;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#aaa;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#aaa;background-color:#eee;}.t-button{background:#e8e8e8;color:#333;}.t-button-hover{background:#ffe79c;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-color:#ddd;border-right:1px solid #eee;}.t-grouping-header .t-group-indicator{color:#333;border-color:#ccc;}.t-grouping-dropclue{background:url('Simple/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row td .t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Simple/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#ffa517;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#aaa;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#999;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Simple/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Simple/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#f1f1f1 #8a8a8a #8a8a8a #f1f1f1;background-color:#e6e6e6;}.t-editor-button .t-state-active{border-color:#a4a4a4 #e0e0e0 #e0e0e0 #a4a4a4;background-color:#c8c8c8;} \ No newline at end of file diff --git a/Content/telerik.sitefinity.min.css b/Content/telerik.sitefinity.min.css new file mode 100644 index 000000000..854bdef60 --- /dev/null +++ b/Content/telerik.sitefinity.min.css @@ -0,0 +1 @@ +.t-widget{border-width:0;border-color:#ccc;background:none;}.t-autocomplete{border-width:1px;border-style:solid;}.t-header,.t-grid-header{border-color:#ccc;background:#fff;}.t-icon{background-image:url('Sitefinity/sprite.png');}.t-editor .t-tool-icon{background-image:url('Sitefinity/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:-16px -272px;}.t-minus,.t-minus-disabled{background-position:0 -272px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-grid .t-header .t-link .t-arrow-down{background-position:0 -256px;}.t-grid .t-header .t-link .t-arrow-up{background-position:-16px -256px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-loading,.t-widget .t-loading{background:transparent url('Sitefinity/loading.gif') no-repeat 0 0;}.t-widget{color:#000;}.t-link,.t-popup{color:#105cd6;}.t-group,.t-content,.t-editable-area{border-color:#ccc #666 #666 #ccc;background-color:#fff;border-width:1px 2px 2px 1px;}.t-colorpicker .t-arrow-down{border-color:#ccc;}.t-separator{border-color:#fff;background-color:#999;}.t-alt{background:none;}.t-state-default{border-color:#eee;}.t-active-filter{background-color:#e5e5e5;}.t-state-hover{background-color:none;border-color:#dee2e7;}.t-state-active{background-color:#fff;border-color:#ccc;}.t-state-selected{background-color:#ffffe1;}.t-state-error{border-color:#e50000;}.t-state-disabled,.t-state-disabled .t-link{color:#afaeae;border-color:#eee;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#ccc;background-color:none;}.t-widget .t-status{border:0;}.t-button{background:#f1f1f1;border-width:1px 2px 2px 1px;color:#333;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border-color:#ccc #666 #666 #ccc;}.t-button-hover{background:#fff;}.t-autocomplete{border-width:1px;border-style:solid;}.t-combobox .t-state-default,.t-dropdown .t-state-default{border-color:#ccc;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid .t-header,.t-grid .t-header .t-link{letter-spacing:1px;text-transform:uppercase;font-size:.866em;line-height:2.6em;color:#666;background:none;}.t-grid .t-header,.t-grid td{border-bottom:1px solid #eee;border-color:#eee;}.t-grid .t-grid-filter{border-left:0;}.t-grouping-header .t-group-indicator{color:#333;border-color:#ccc;}.t-grouping-dropclue{background:url('Sitefinity/sprite.png') no-repeat -48px -288px;}.t-treeview .t-drop-clue{background-image:url('Sitefinity/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#999;}.t-pager-wrapper .t-state-hover{color:#002bb8;background:#f0f0f0;}.t-menu .t-state-hover,.t-panelbar .t-state-hover,.t-tabstrip .t-state-hover{color:#002bb8;background:none;}.t-tabstrip{border:1px solid #ccc;}.t-tabstrip .t-state-default,.t-tabstrip .t-state-disabled{border-bottom-color:#ccc;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#aaa;}.t-calendar th{border-color:#ddd;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Sitefinity/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Sitefinity/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-window-titlebar,.t-drag-clue{background-color:#fff;} \ No newline at end of file diff --git a/Content/telerik.sunset.min.css b/Content/telerik.sunset.min.css new file mode 100644 index 000000000..c4f594088 --- /dev/null +++ b/Content/telerik.sunset.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#714734;background-color:#ececd8;}.t-header,.t-grid-header{border-color:#854324;background:#90330a url('Sunset/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Sunset/sprite.png');}.t-editor .t-tool-icon{background-image:url('Sunset/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Sunset/loading.gif') no-repeat 0 0;}.t-widget,.t-link,.t-popup{color:#333;}.t-header,.t-header .t-link{color:#fbfbc7;}.t-header .t-group,.t-group .t-link{color:#333;}.t-group,.t-content,.t-editable-area{border-color:#bbb99d;background-color:#ececd8;}.t-colorpicker .t-arrow-down{border-color:#714734;}.t-separator{border-color:#a85835;background-color:#7c2f0c;}.t-alt{background-color:#fff;}.t-state-default{border-color:#854324;}.t-active-filter{background-color:#d25e21;}.t-state-hover{background-color:#c5551c;border-color:#854324;}.t-state-hover,.t-state-hover .t-link,.t-group .t-state-hover{color:#fff;}.t-state-active{background-color:#ececd8;border-color:#854324;}.t-state-active,.t-state-active .t-link{color:#333;}.t-state-active .t-header,.t-state-active .t-state-hover{color:#fff;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{border-color:#666;color:#bf9e8f;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#bbb99d;background-color:#dee0c8;}.t-button{background:#e8e8e8 url('Sunset/sprite.png') repeat-x 0 -96px;color:#333;border-color:#d1711a;color:#2d0e06;}.t-button-hover{background-position:0 -128px;border-color:#e7941e;}.t-panelbar .t-link{border-color:#714734;}.t-tabstrip li.t-state-active{border-bottom-color:#ececd8;}.t-editor-button .t-state-active{background-color:#d3751a;}.t-grid td{border-color:#ddd;border-right:1px solid #eee;}.t-grouping-row td{background:#fff url('Sunset/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#999;}.t-grouping-dropclue{background:url('Sunset/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Sunset/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#904C23;background-color:#ea9959;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#d2c7b4;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Sunset/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Sunset/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#ca734b #722205 #722205 #ca734b;background-color:#a13606;}.t-editor-button .t-state-active{border-color:#a24b0f #e09d5c #e09d5c #a24b0f;background-color:#d3751a;} \ No newline at end of file diff --git a/Content/telerik.telerik.min.css b/Content/telerik.telerik.min.css new file mode 100644 index 000000000..2ba008e4f --- /dev/null +++ b/Content/telerik.telerik.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#828282;background-color:#fff;}.t-header,.t-grid-header{border-color:#828282;background:#f6f6f6 url('Telerik/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Telerik/sprite.png');}.t-editor .t-tool-icon{background-image:url('Telerik/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Telerik/loading.gif') no-repeat 0 0;}.t-widget,.t-link:link,.t-link:active,.t-link:visited,.t-popup{color:#000;}.t-group,.t-content,.t-editable-area{border-color:#828282;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#828282;}.t-separator{border-color:#f3f3f3;background-color:#bdbdbd;}.t-alt{background-color:#f7f7f7;}.t-state-default{border-color:#828282;}.t-active-filter{background-color:#dfdfdf;}.t-state-hover{background-color:#b6f0a3;border-color:#239500;}.t-state-active{background-color:#fff;border-color:#239500;}.t-state-selected{background-color:#8cc569;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#aaa;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#aaa;background-color:#eee;}.t-button{background:#e8e8e8 url('Telerik/sprite.png') repeat-x 0 -96px;color:#333;}.t-button-hover{background-position:0 -128px;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-color:#ddd;border-right:1px solid #eee;}.t-grouping-row td{background:#fff url('Telerik/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#ccc;}.t-grouping-dropclue{background:url('Telerik/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Telerik/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#1c7600;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#aaa;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#c5c5c5;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Telerik/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Telerik/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#d6f1cd #809a77 #809a77 #d6f1cd;background-color:#c0e9b3;}.t-editor-button .t-state-active{border-color:#8c8c8c #d8d8d8 #d8d8d8 #8c8c8c;background-color:#c4c4c4;} \ No newline at end of file diff --git a/Content/telerik.vista.min.css b/Content/telerik.vista.min.css new file mode 100644 index 000000000..7449bcb00 --- /dev/null +++ b/Content/telerik.vista.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#a7bac5;background-color:#fff;}.t-widget,.t-widget button,.t-widget input,.t-widget select,.t-button{font-family:"Segoe UI",Arial,sans-serif;}.t-header,.t-grid-header{border-color:#a7bac5;background:#a6d9f4 url('Vista/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Vista/sprite.png');}.t-editor .t-tool-icon{background-image:url('Vista/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied,.t-cancel{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Vista/loading.gif') no-repeat 0 0;}.t-widget,.t-link:link,.t-link:active,.t-link:visited,.t-popup{color:#000;}.t-group,.t-content,.t-editable-area{border-color:#a7bac5;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#a7bac5;}.t-separator{border-color:#eaf6fd;background-color:#a7bac5;}.t-alt{background-color:#f7f7f7;}.t-state-default{border-color:#a7bac5;}.t-active-filter{background-color:#ceeefd;}.t-state-hover{background-color:#e3f4fc;border-color:#a7bac5;}.t-state-active{background-color:#fff;border-color:#a7bac5;}.t-state-selected{background-color:#c8e8f8;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#8a8a8a;border-color:#bbb;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#bbb;background-color:#eff7fc;}.t-button{background:#e8e8e8 url('Vista/sprite.png') repeat-x 0 -96px;color:#333;}.t-button-hover{background-position:0 -128px;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-color:#ddd;border-right:1px solid #eee;}.t-grouping-row td{background:#fff url('Vista/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#ccc;}.t-grouping-dropclue{background:url('Vista/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-grouping-row p{margin-left:-.6em;padding-left:.6em;}.t-treeview .t-drop-clue{background-image:url('Vista/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#99defd;}.t-panelbar .t-link,.t-panelbar .t-group,.t-panelbar .t-content{border-color:#aaa;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#e0e0e0;}.t-other-month .t-link{color:#777;}.t-editor-button .t-state-hover{border-color:#ebf6fd #88a1af #88a1af #ebf6fd;background-color:#c9e8fa;}.t-editor-button .t-state-active{border-color:#809eae #bae1f5 #bae1f5 #809eae;background-color:#95cfec;} \ No newline at end of file diff --git a/Content/telerik.web20.min.css b/Content/telerik.web20.min.css new file mode 100644 index 000000000..adc77eb04 --- /dev/null +++ b/Content/telerik.web20.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#4e75b3;background-color:#fff;}.t-header,.t-grid-header{border-color:#4a70ae;background:#7fa5d7 url('Web20/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('Web20/sprite.png');}.t-editor .t-tool-icon{background-image:url('Web20/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-header .t-arrow-up,.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-header .t-arrow-down,.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-header .t-arrow-first,.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-header .t-arrow-prev,.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-header .t-arrow-next,.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-header .t-arrow-last,.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Web20/loading.gif') no-repeat 0 0;}.t-widget,.t-link,.t-popup{color:#333;}.t-header,.t-header .t-link{color:#fff;}.t-header .t-group,.t-group .t-link{color:#333;}.t-group,.t-content,.t-editable-area{border-color:#4a70ae;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#4e75b3;}.t-separator{border-color:#93b2dc;background-color:#688bbb;}.t-alt{background-color:#fff;}.t-state-default{border-color:#4a70ae;}.t-active-filter{background-color:#87a6d4;}.t-state-hover{background-color:#a4c2f1;border-color:#4a70ae;}.t-state-hover,.t-state-hover .t-link,.t-header .t-state-hover,.t-group .t-state-hover{color:#333;}.t-state-active{background-color:#fff;border-color:#4a70ae;}.t-state-active,.t-state-active .t-link,.t-state-active .t-header .t-state-active,.t-state-active .t-header .t-state-active .t-link{color:#333;}.t-state-active .t-header,.t-state-active .t-header .t-link{color:#fff;}.t-state-active .t-state-hover,.t-state-active .t-header .t-state-hover .t-link{color:#333;}.t-state-selected{background-color:#d4ffbc;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#bbb;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#829cbf;background-color:#e3eeff;}.t-button{background:#e8e8e8 url('Web20/sprite.png') repeat-x 0 -96px;color:#fff;}.t-button-hover{background-position:0 -128px;color:#0f3789;}.t-panelbar .t-link{border-color:#333;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td,.t-grid .t-last{border-bottom:1px solid #cfd9e7;border-right:1px solid #829cbf;}.t-grouping-row td{background:#fff url('Web20/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#ccc;}.t-grouping-dropclue{background:url('Web20/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Web20/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#85c843;}.t-panelbar .t-state-hover{background-image:none;}.t-editor-button .t-state-active{background-color:#4567ba;}.t-calendar th{background-color:#ecf4ff;border-color:#bcd2f1;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('Web20/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('Web20/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-drag-clue{color:#fff;}.t-editor-button .t-state-hover{border-color:#8ea9d1 #385b9d #385b9d #8ea9d1;background-color:#7fa5d7;}.t-editor-button .t-state-active{border-color:#3a5c9d #89a2cc #89a2cc #3a5c9d;background-color:#567cb8;} \ No newline at end of file diff --git a/Content/telerik.webblue.min.css b/Content/telerik.webblue.min.css new file mode 100644 index 000000000..631c458f4 --- /dev/null +++ b/Content/telerik.webblue.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#768ca5;background-color:#fff;}.t-header,.t-grid-header{border-color:#426682;background:#718ca1 url('WebBlue/sprite.png') repeat-x 0 -368px;}.t-icon{background-image:url('WebBlue/sprite.png');}.t-editor .t-tool-icon{background-image:url('WebBlue/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-header .t-arrow-up,.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-header .t-arrow-down,.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-header .t-arrow-first,.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-header .t-arrow-prev,.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-header .t-arrow-next,.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-header .t-arrow-last,.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-cancel{background-position:-48px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('WebBlue/loading.gif') no-repeat 0 0;}.t-widget,.t-link,.t-popup{color:#333;}.t-header,.t-header .t-link{color:#fff;}.t-header .t-group,.t-group .t-link{color:#333;}.t-group,.t-content,.t-editable-area{border-color:#426682;background-color:#fff;}.t-colorpicker .t-arrow-down{border-color:#768ca5;}.t-separator{border-color:#8aa0b1;background-color:#516273;}.t-alt{background-color:#dae2e8;}.t-state-default{border-color:#426682;}.t-active-filter{background-color:#8dc1d7;}.t-state-hover{background-color:#acd4e3;border-color:#5d9fb7;}.t-state-hover,.t-state-hover .t-link,.t-header .t-state-hover,.t-group .t-state-hover{color:#333;}.t-state-active{background-color:#fff;border-color:#426682;}.t-state-active,.t-state-active .t-link{color:#333;}.t-state-active .t-header{color:#fff;}.t-state-active .t-state-hover{color:#333;}.t-state-selected{background-color:#3e94b4;color:#fff;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#bbb;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#a2b3c7;background-color:#dae2e8;}.t-button{background:#e8e8e8 url('WebBlue/sprite.png') repeat-x 0 -96px;color:#0d202b;}.t-button-hover{background-position:0 -128px;color:#0e3d4f;}.t-panelbar .t-link{border-color:#333;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-right:1px solid #dae2e8;}.t-grouping-row td{background:#fff url('WebBlue/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#aaa;}.t-grouping-dropclue{background:url('WebBlue/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('WebBlue/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#133C44;}.t-panelbar .t-state-hover{background-image:none;}.t-editor-button .t-state-active{background-color:#a2b9c9;}.t-calendar th{background-color:#dfeeff;border-color:#a7c0df;}.t-other-month .t-link{color:#777;}.t-treeview-lines .t-top,.t-treeview-lines .t-mid,.t-treeview-lines .t-bot{background-image:url('WebBlue/treeview-nodes.png');background-repeat:no-repeat;margin-left:-16px;padding-left:16px;}.t-treeview-lines .t-item{background-image:url('WebBlue/treeview-line.png');}.t-treeview-lines .t-last{background-image:none;}.t-editor-button .t-state-hover{border-color:#5f7c95 #3b576f #3b576f #5f7c95;background-color:#5f7c95;}.t-editor-button .t-state-active{border-color:#5b758e #97b5c7 #97b5c7 #5b758e;background-color:#8ca5b8;} \ No newline at end of file diff --git a/Content/telerik.windows7.min.css b/Content/telerik.windows7.min.css new file mode 100644 index 000000000..6b178299f --- /dev/null +++ b/Content/telerik.windows7.min.css @@ -0,0 +1 @@ +.t-widget{border-color:#a5b3c5;background-color:#fcfcfc;}.t-header,.t-grid-header{border-color:#a5b3c5;background:#f1f5fb;}.t-icon{background-image:url('Windows7/sprite.png');}.t-editor .t-tool-icon{background-image:url('Windows7/editor.png');}.t-expand{background-position:0 -160px;}.t-collapse{background-position:0 -176px;}.t-plus,.t-plus-disabled{background-position:0 -256px;}.t-minus,.t-minus-disabled{background-position:-16px -256px;}.t-arrow-up{background-position:-16px -160px;}.t-arrow-down{background-position:-16px -176px;}.t-header .t-arrow-up,.t-state-hover .t-arrow-up{background-position:-48px -160px;}.t-header .t-arrow-down,.t-state-hover .t-arrow-down{background-position:-48px -176px;}.t-state-disabled .t-arrow-up{background-position:-32px -160px;}.t-state-disabled .t-arrow-down{background-position:-32px -176px;}.t-numerictextbox .t-arrow-up{background-position:-16px -162px;}.t-numerictextbox .t-arrow-down{background-position:-16px -178px;}.t-arrow-up-small{background-position:0 -304px;}.t-arrow-down-small{background-position:-16px -304px;}.t-arrow-first{background-position:0 -192px;}.t-arrow-prev{background-position:-16px -192px;}.t-arrow-next{background-position:-32px -192px;}.t-arrow-last{background-position:-48px -192px;}.t-header .t-arrow-first,.t-state-hover .t-arrow-first{background-position:0 -224px;}.t-header .t-arrow-prev,.t-state-hover .t-arrow-prev{background-position:-16px -224px;}.t-header .t-arrow-next,.t-state-hover .t-arrow-next{background-position:-32px -224px;}.t-header .t-arrow-last,.t-state-hover .t-arrow-last{background-position:-48px -224px;}.t-state-disabled .t-arrow-first{background-position:0 -208px;}.t-state-disabled .t-arrow-prev{background-position:-16px -208px;}.t-state-disabled .t-arrow-next{background-position:-32px -208px;}.t-state-disabled .t-arrow-last{background-position:-48px -208px;}.t-filter{background-position:0 -240px;}.t-clear-filter{background-position:-16px -240px;}.t-refresh{background-position:-32px -240px;}.t-icon-calendar{background-position:-48px -240px;}.t-edit{background-position:0 -336px;}.t-delete{background-position:-16px -336px;}.t-insert,.t-update{background-position:-32px -336px;}.t-group-delete{background-position:0 -288px;}.t-maximize{background-position:-16px -288px;}.t-restore{background-position:-32px -288px;}.t-close{background-position:-64px -288px;}.t-insert-top{background-position:0 -320px;}.t-insert-middle{background-position:-16px -320px;}.t-insert-bottom{background-position:-32px -320px;}.t-add{background-position:-48px -320px;}.t-denied,.t-cancel{background-position:-64px -320px;}.t-loading,.t-widget .t-loading{background:transparent url('Windows7/loading.gif') no-repeat 0 0;}.t-widget,.t-link,.t-popup{color:#000;}.t-header,.t-header .t-link{color:#4c607a;}.t-header .t-group,.t-group .t-link{color:#333;}.t-group,.t-content,.t-editable-area{border-color:#a5b3c5;background-color:#fcfcfc;}.t-colorpicker .t-arrow-down{border-color:#a5b3c5;}.t-separator{border-color:#fff;background-color:#c2cedb;}.t-alt{background-color:#ebeff3;}.t-state-default{border-color:#a5b3c5;}.t-active-filter{background-color:#c3dcfa;}.t-state-hover{background-color:#d1e4fc;border-color:#8daed5;}.t-state-hover,.t-state-hover .t-link,.t-header .t-state-hover,.t-group .t-state-hover{color:#000;}.t-state-active{background-color:#fff;border-color:#426682;}.t-state-selected{background-color:#deecfe;}.t-state-error{border-style:ridge;border-color:#f00;background-color:#ffc0cb;}.t-state-disabled,.t-state-disabled .t-link{color:#888;}.t-toolbar,.t-grouping-header,.t-widget .t-pager-wrapper,.t-grid-footer,.t-widget .t-status{border-color:#aec5d1;background-color:#f1f5fb;}.t-button{background:#e8e8e8 url('Windows7/sprite.png') repeat-x 0 -96px;color:#0d202b;border-color:#c2cedb;}.t-button-hover{background-position:0 -128px;color:#0e3d4f;border-color:#9bc9ff;}.t-panelbar .t-link{border-color:#a5b3c5;}.t-tabstrip .t-item{border-bottom-color:#426682;}.t-tabstrip li.t-state-active{border-bottom-color:#fff;}.t-grid td{border-right:1px solid #dae2e8;}.t-grouping-row td{background:#fff url('Windows7/sprite.png') repeat-x 0 -48px;}.t-grouping-header .t-group-indicator{color:#333;border-color:#ccc;}.t-grouping-dropclue{background:url('Windows7/sprite.png') no-repeat -48px -288px;}.t-grouping-row .t-group-cell,.t-grouping-row p{background:#fff;}.t-treeview .t-drop-clue{background-image:url('Windows7/sprite.png');background-position:0 -358px;}.t-treeview .t-state-selected{border-color:#8fb0d6;}.t-panelbar .t-state-hover{background-image:none;}.t-calendar th{border-color:#d4dbe5;}.t-other-month .t-link{color:#a7a7a7;}.t-editor-button .t-state-hover{border-color:#e5f0fd #8ba6c4 #8ba6c4 #e5f0fd;background-color:#d1e4fc;}.t-editor-button .t-state-active{border-color:#aec1d6 #e3ebf5 #e3ebf5 #aec1d6;background-color:#ccdbed;} \ No newline at end of file diff --git a/NzbDrone.Core.Test/Fixtures.cs b/NzbDrone.Core.Test/Fixtures.cs index 74bca0b8a..ec26a1b81 100644 --- a/NzbDrone.Core.Test/Fixtures.cs +++ b/NzbDrone.Core.Test/Fixtures.cs @@ -23,5 +23,11 @@ namespace NzbDrone.Core.Test } } + + [SetUp] + public void Setup() + { + Main.ConfigureNlog(); + } } } \ No newline at end of file diff --git a/NzbDrone.Core.Test/SeriesTest.cs b/NzbDrone.Core.Test/SeriesTest.cs index a9117f939..1815bc773 100644 --- a/NzbDrone.Core.Test/SeriesTest.cs +++ b/NzbDrone.Core.Test/SeriesTest.cs @@ -68,8 +68,47 @@ namespace NzbDrone.Core.Test moqData.Verify(c => c.Add(It.IsAny()), Times.Once()); } - [Test] + [Test] + [Row(0)] + [Row(1)] + [Row(2)] + [Row(3)] + public void register_series_with_match(int matchPosition) + { + TvdbSeries fakeSeries = Builder.CreateNew().With(f => f.SeriesName = "The Simpsons").Build(); + var fakeSearch = Builder.CreateListOfSize(4).Build(); + fakeSearch[matchPosition].Id = fakeSeries.Id; + fakeSearch[matchPosition].SeriesName = fakeSeries.SeriesName; + + + //Arrange + var moqData = new Mock(); + var moqTvdb = new Mock(); + + moqData.Setup(f => f.Exists(c => c.TvdbId == It.IsAny())).Returns(false); + + moqTvdb.Setup(f => f.SearchSeries(It.IsAny())).Returns(fakeSearch); + moqTvdb.Setup(f => f.GetSeries(fakeSeries.Id, It.IsAny())).Returns(fakeSeries); + + var kernel = new MockingKernel(); + kernel.Bind().ToConstant(moqData.Object); + kernel.Bind().ToConstant(moqTvdb.Object); + kernel.Bind().To(); + + + //Act + var seriesController = kernel.Get(); + seriesController.RegisterSeries(@"D:\TV Shows\The Simpsons"); + + //Assert + //Verify that the show was added to the database only once. + moqData.Verify(c => c.Add(It.Is(d => d.TvdbId == fakeSeries.Id)), Times.Once()); + } + + + + [Test] [Description("This test confirms that the tvdb id stored in the db is preserved rather than being replaced by an auto incrementing value")] public void tvdbid_is_preserved([RandomNumbers(Minimum = 100, Maximum = 999, Count = 1)] int tvdbId) { @@ -86,5 +125,26 @@ namespace NzbDrone.Core.Test Assert.IsNotEmpty(allSeries); Assert.AreEqual(tvdbId, allSeries.First().TvdbId); } + + [Test] + [Row(new object[] { "CAPITAL", "capital", true })] + [Row(new object[] { "Something!!", "Something", true })] + [Row(new object[] { "Simpsons 2000", "Simpsons", true })] + [Row(new object[] { "Simp222sons", "Simpsons", true })] + [Row(new object[] { "Simpsons", "The Simpsons", true })] + [Row(new object[] { "Law and order", "Law & order", true })] + [Row(new object[] { "xxAndxx", "xxxx", false })] + [Row(new object[] { "Andxx", "xx", false })] + [Row(new object[] { "xxAnd", "xx", false })] + [Row(new object[] { "Thexx", "xx", false })] + [Row(new object[] { "Thexx", "xx", false })] + [Row(new object[] { "xxThexx", "xxxxx", false })] + [Row(new object[] { "Simpsons The", "Simpsons", true })] + public void Name_match_test(string a, string b, bool match) + { + bool result = SeriesProvider.IsTitleMatch(a, b); + + Assert.AreEqual(match, result, "{0} , {1}", a, b); + } } } diff --git a/NzbDrone.Core/Libraries/CassiniDev-lib.dll b/NzbDrone.Core/Libraries/CassiniDev-lib.dll deleted file mode 100644 index da1339232..000000000 Binary files a/NzbDrone.Core/Libraries/CassiniDev-lib.dll and /dev/null differ diff --git a/NzbDrone.Core/Libraries/NLog.Extended.dll b/NzbDrone.Core/Libraries/NLog.Extended.dll new file mode 100644 index 000000000..762a6a992 Binary files /dev/null and b/NzbDrone.Core/Libraries/NLog.Extended.dll differ diff --git a/NzbDrone.Core/Libraries/NLog.Extended.xml b/NzbDrone.Core/Libraries/NLog.Extended.xml new file mode 100644 index 000000000..3838cfbe7 --- /dev/null +++ b/NzbDrone.Core/Libraries/NLog.Extended.xml @@ -0,0 +1,432 @@ + + + + NLog.Extended + + + + + ASP.NET Application variable. + + + Use this layout renderer to insert the value of the specified variable stored + in the ASP.NET Application dictionary. + + + You can set the value of an ASP.NET Application variable by using the following code: + + + + Example usage of ${aspnet-application}: + + ${aspnet-application:variable=myvariable} - produces "123" + ${aspnet-application:variable=anothervariable} - produces "01/01/2006 00:00:00" + ${aspnet-application:variable=anothervariable:culture=pl-PL} - produces "2006-01-01 00:00:00" + ${aspnet-application:variable=myvariable:padding=5} - produces " 123" + ${aspnet-application:variable=myvariable:padding=-5} - produces "123 " + ${aspnet-application:variable=stringvariable:upperCase=true} - produces "AAA BBB" + + + + + + Renders the specified ASP.NET Application variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the variable name. + + + + + + ASP.NET Request variable. + + + Use this layout renderer to insert the value of the specified parameter of the + ASP.NET Request object. + + + Example usage of ${aspnet-request}: + + ${aspnet-request:item=v} + ${aspnet-request:querystring=v} + ${aspnet-request:form=v} + ${aspnet-request:cookie=v} + ${aspnet-request:serverVariable=v} + + + + + + Renders the specified ASP.NET Request variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the item name. The QueryString, Form, Cookies, or ServerVariables collection variables having the specified name are rendered. + + + + + + Gets or sets the QueryString variable to be rendered. + + + + + + Gets or sets the form variable to be rendered. + + + + + + Gets or sets the cookie to be rendered. + + + + + + Gets or sets the ServerVariables item to be rendered. + + + + + + ASP.NET Session ID. + + + + + Renders the ASP.NET Session ID appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + ASP.NET Session variable. + + + Use this layout renderer to insert the value of the specified variable stored + in the ASP.NET Session dictionary. + + + You can set the value of an ASP.NET Session variable by using the following code: + + + + Example usage of ${aspnet-session}: + + ${aspnet-session:variable=myvariable} - produces "123" + ${aspnet-session:variable=anothervariable} - produces "01/01/2006 00:00:00" + ${aspnet-session:variable=anothervariable:culture=pl-PL} - produces "2006-01-01 00:00:00" + ${aspnet-session:variable=myvariable:padding=5} - produces " 123" + ${aspnet-session:variable=myvariable:padding=-5} - produces "123 " + ${aspnet-session:variable=stringvariable:upperCase=true} - produces "AAA BBB" + + + + + + Renders the specified ASP.NET Session value and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the session variable name. + + + + + + ASP.NET User variable. + + + + + Renders the specified ASP.NET User.Identity.AuthenticationType variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + ASP.NET User variable. + + + + + Renders the specified ASP.NET User.Identity.Name variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Writes log messages to the ASP.NET trace. + + Documentation on NLog Wiki + + Log entries can then be viewed by navigating to http://server/path/Trace.axd. + + + + + Writes the specified logging event to the ASP.NET Trace facility. + If the log level is greater than or equal to it uses the + method, otherwise it uses + method. + + The logging event. + + + + Writes log message to the specified message queue handled by MSMQ. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ You can use a single target to write to multiple queues (similar to writing to multiple files with the File target). +

+ +

+ The above examples assume just one target and a single rule. + More configuration options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +
+
+ + + Initializes a new instance of the class. + + + The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message} + + + + + Writes the specified logging event to a queue specified in the Queue + parameter. + + The logging event. + + + + Prepares a message to be sent to the message queue. + + The log event to be used when calculating label and text to be written. + The message to be sent. + + You may override this method in inheriting classes + to provide services like encryption or message + authentication. + + + + + Gets or sets the name of the queue to write to. + + + To write to a private queue on a local machine use .\private$\QueueName. + For other available queue names, consult MSMQ documentation. + + + + + + Gets or sets the label to associate with each message. + + + By default no label is associated. + + + + + + Gets or sets a value indicating whether to create the queue if it doesn't exists. + + + + + + Gets or sets a value indicating whether to use recoverable messages (with guaranteed delivery). + + + + + + Gets or sets the encoding to be used when writing text to the queue. + + + + + + Gets or sets a value indicating whether to use the XML format when serializing message. + + + + + + Buffers log events for the duration of ASP.NET request and sends them down + to the wrapped target at the end of a request. + + Documentation on NLog Wiki + +

+ Typically this target is used in cooperation with PostFilteringTargetWrapper + to provide verbose logging for failing requests and normal or no logging for + successful requests. We need to make the decision of the final filtering rule + to apply after all logs for a page have been generated. +

+

+ To use this target, you need to add an entry in the httpModules section of + web.config: +

+ + + + + + + + + + ]]> + +
+ +

To set up the ASP.NET Buffering target wrapper configuration file, put + the following in web.nlog file in your web application directory (this assumes + that PostFilteringWrapper is used to provide the filtering and actual logs go to + a file). +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To configure the target programmatically, put the following + piece of code in your Application_OnStart() handler in Global.asax.cs + or some other place that gets executed at the very beginning of your code: +

+ +

+ Fully working C# project can be found in the Examples/Targets/Configuration API/ASPNetBufferingWrapper + directory along with usage instructions. +

+
+
+ + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The wrapped target. + + + + Initializes a new instance of the class. + + The wrapped target. + Size of the buffer. + + + + Initializes the target by hooking up the NLogHttpModule BeginRequest and EndRequest events. + + + + + Closes the target by flushing pending events in the buffer (if any). + + + + + Adds the specified log event to the buffer. + + The log event. + + + + Gets or sets the number of log events to be buffered. + + + + + + Gets or sets a value indicating whether buffer should grow as needed. + + A value of true if buffer should grow as needed; otherwise, false. + + Value of true causes the buffer to expand until is hit, + false causes the buffer to never expand and lose the earliest entries in case of overflow. + + + + + + Gets or sets the maximum number of log events that the buffer can keep. + + + + + + ASP.NET HttpModule that enables NLog to hook BeginRequest and EndRequest events easily. + + + + + Initializes the HttpModule. + + + ASP.NET application. + + + + + Disposes the module. + + + + + Event to be raised at the end of each HTTP Request. + + + + + Event to be raised at the beginning of each HTTP Request. + + +
+
diff --git a/NzbDrone.Core/Libraries/NLog.dll b/NzbDrone.Core/Libraries/NLog.dll index cd8e7d651..8a27b27f3 100644 Binary files a/NzbDrone.Core/Libraries/NLog.dll and b/NzbDrone.Core/Libraries/NLog.dll differ diff --git a/NzbDrone.Core/Libraries/NLog.pdb b/NzbDrone.Core/Libraries/NLog.pdb index ebfc192d5..a9996beef 100644 Binary files a/NzbDrone.Core/Libraries/NLog.pdb and b/NzbDrone.Core/Libraries/NLog.pdb differ diff --git a/NzbDrone.Core/Libraries/NLog.xml b/NzbDrone.Core/Libraries/NLog.xml index 4f7c291c9..cd0c12c15 100644 --- a/NzbDrone.Core/Libraries/NLog.xml +++ b/NzbDrone.Core/Libraries/NLog.xml @@ -4,6 +4,266 @@ NLog + + + NLog COM Interop logger implementation. + + + + + NLog COM Interop logger interface. + + + + + Writes the diagnostic message at the specified level. + + The log level. + A to be written. + + + + Writes the diagnostic message at the Trace level. + + A to be written. + + + + Writes the diagnostic message at the Debug level. + + A to be written. + + + + Writes the diagnostic message at the Info level. + + A to be written. + + + + Writes the diagnostic message at the Warn level. + + A to be written. + + + + Writes the diagnostic message at the Error level. + + A to be written. + + + + Writes the diagnostic message at the Fatal level. + + A to be written. + + + + Checks if the specified log level is enabled. + + The log level. + A value indicating whether the specified log level is enabled. + + + + Gets a value indicating whether the Trace level is enabled. + + + + + Gets a value indicating whether the Debug level is enabled. + + + + + Gets a value indicating whether the Info level is enabled. + + + + + Gets a value indicating whether the Warn level is enabled. + + + + + Gets a value indicating whether the Error level is enabled. + + + + + Gets a value indicating whether the Fatal level is enabled. + + + + + Gets or sets the logger name. + + + + + Writes the diagnostic message at the specified level. + + The log level. + A to be written. + + + + Writes the diagnostic message at the Trace level. + + A to be written. + + + + Writes the diagnostic message at the Debug level. + + A to be written. + + + + Writes the diagnostic message at the Info level. + + A to be written. + + + + Writes the diagnostic message at the Warn level. + + A to be written. + + + + Writes the diagnostic message at the Error level. + + A to be written. + + + + Writes the diagnostic message at the Fatal level. + + A to be written. + + + + Checks if the specified log level is enabled. + + The log level. + + A value indicating whether the specified log level is enabled. + + + + + Gets a value indicating whether the Trace level is enabled. + + + + + + Gets a value indicating whether the Debug level is enabled. + + + + + + Gets a value indicating whether the Info level is enabled. + + + + + + Gets a value indicating whether the Warn level is enabled. + + + + + + Gets a value indicating whether the Error level is enabled. + + + + + + Gets a value indicating whether the Fatal level is enabled. + + + + + + Gets or sets the logger name. + + + + + + NLog COM Interop LogManager implementation. + + + + + NLog COM Interop LogManager interface. + + + + + Loads NLog configuration from the specified file. + + The name of the file to load NLog configuration from. + + + + Creates the specified logger object and assigns a LoggerName to it. + + Logger name. + The new logger instance. + + + + Gets or sets a value indicating whether internal messages should be written to the console. + + + + + Gets or sets the name of the internal log file. + + + + + Gets or sets the name of the internal log level. + + + + + Creates the specified logger object and assigns a LoggerName to it. + + The name of the logger. + The new logger instance. + + + + Loads NLog configuration from the specified file. + + The name of the file to load NLog configuration from. + + + + Gets or sets a value indicating whether to log internal messages to the console. + + + A value of true if internal messages should be logged to the console; otherwise, false. + + + + + Gets or sets the name of the internal log level. + + + + + + Gets or sets the name of the internal log file. + + + Asynchronous continuation delegate - function invoked at the end of asynchronous @@ -445,6 +705,19 @@ The message. The inner exception. + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + The parameter is null. + + + The class name is null or is zero (0). + + Condition layout expression (represented by a string literal @@ -773,6 +1046,19 @@ The message. The inner exception. + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + The parameter is null. + + + The class name is null or is zero (0). + + Condition parser. Turns a string representation of condition expression @@ -1037,6 +1323,20 @@ Gets the XML element name. + + + NLog configuration section handler class for configuring NLog from App.config. + + + + + Creates a configuration section handler. + + Parent object. + Configuration context object. + Section XML node. + The created section handler object. + Provides registration information for named items (targets, layouts, layout renderers, etc.) managed by NLog. @@ -1274,6 +1574,11 @@ Provides context for install/uninstall operations. + + + Mapping between log levels and console output colors. + + Initializes a new instance of the class. @@ -1484,6 +1789,30 @@ The new configuration. + + + Arguments for . + + + + + Initializes a new instance of the class. + + Whether configuration reload has succeeded. + The exception during configuration reload. + + + + Gets a value indicating whether configuration reload has succeeded. + + A value of true if succeeded; otherwise, false. + + + + Gets the exception which occurred during configuration reload. + + The exception. + Represents a logging rule. An equivalent of <logger /> configuration element. @@ -1784,6 +2113,19 @@ Provides simple programmatic configuration API used for trivial logging cases. + + + Configures NLog for console logging so that all messages above and including + the level are output to the console. + + + + + Configures NLog for console logging so that all messages above and including + the specified level are output to the console. + + The minimal logging level. + Configures NLog for to log to the specified target so that all messages @@ -1908,6 +2250,12 @@ Name of the file that contains the element (to be used as a base for including other files). Ignore any errors during configuration. + + + Gets the default object by parsing + the application configuration file (app.exe.config). + + Gets or sets a value indicating whether the configuration files @@ -2235,9 +2583,9 @@ Clears the content of the GDC. - + - Helpers for .NET Compact Framework. + Various helper methods for accessing state of ASP application. @@ -2491,6 +2839,11 @@ The enumerable. List of elements. + + + Safe way to get environment variables. + + Helper class for dealing with exceptions. @@ -2667,6 +3020,67 @@ Interface that provides parameters for create file function. + + + Provides a multiprocess-safe atomic file appends while + keeping the files open. + + + On Unix you can get all the appends to be atomic, even when multiple + processes are trying to write to the same file, because setting the file + pointer to the end of the file and appending can be made one operation. + On Win32 we need to maintain some synchronization between processes + (global named mutex is used for this) + + + + + Initializes a new instance of the class. + + Name of the file. + The parameters. + + + + Writes the specified bytes. + + The bytes to be written. + + + + Closes this instance. + + + + + Flushes this instance. + + + + + Gets the file info. + + The last write time. + Length of the file. + + True if the operation succeeded, false otherwise. + + + + + Factory class. + + + + + Opens the appender for given file name and parameters. + + Name of the file. + Creation parameters. + + Instance of which can be used to write to the file. + + Multi-process and multi-host file appender which attempts @@ -2794,6 +3208,50 @@ Length of the file. A value of true if file information was retrieved successfully, false otherwise. + + + Form helper methods. + + + + + Creates RichTextBox and docks in parentForm. + + Name of RichTextBox. + Form to dock RichTextBox. + Created RichTextBox. + + + + Finds control embedded on searchControl. + + Name of the control. + Control in which we're searching for control. + A value of null if no control has been found. + + + + Finds control of specified type embended on searchControl. + + The type of the control. + Name of the control. + Control in which we're searching for control. + + A value of null if no control has been found. + + + + + Creates a form. + + Name of form. + Width of form. + Height of form. + Auto show form. + If set to true the form will be minimized. + If set to true the form will be created as tool window. + Created form. + Interface implemented by layouts and layout renderers. @@ -2806,6 +3264,11 @@ The log event. String representation of a layout. + + + Supports mocking of SMTP Client code. + + Supports object initialization and termination. @@ -2832,22 +3295,6 @@ Gets the level of stack trace information required by the implementing class. - - - Define Localizable attribute for platforms that don't have it. - - - - - Initializes a new instance of the class. - - Determines whether the target is localizable. - - - - Gets or sets a value indicating whether the target is localizable. - - Logger configuration. @@ -2875,6 +3322,88 @@ A value of true if the specified level is enabled; otherwise, false. + + + Watches multiple files at the same time and raises an event whenever + a single change is detected in any of those files. + + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Stops the watching. + + + + + Watches the specified files for changes. + + The file names. + + + + Occurs when a change is detected in one of the monitored files. + + + + + Supports mocking of SMTP Client code. + + + + + Sends a QUIT message to the SMTP server, gracefully ends the TCP connection, and releases all resources used by the current instance of the class. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + + + + Supports mocking of SMTP Client code. + + Creates instances of objects for given URLs. @@ -3005,16 +3534,6 @@ A newly created network sender. - - - Emulate missing functionality from .NET Compact Framework - - - - - Emulate missing functionality from .NET Compact Framework - - Socket proxy for mocking Socket code. @@ -3033,25 +3552,25 @@ Closes the wrapped socket. - + Invokes ConnectAsync method on the wrapped socket. - The instance containing the event data. + The instance containing the event data. Result of original method. - + Invokes SendAsync method on the wrapped socket. - The instance containing the event data. + The instance containing the event data. Result of original method. - + Invokes SendToAsync method on the wrapped socket. - The instance containing the event data. + The instance containing the event data. Result of original method. @@ -3109,7 +3628,7 @@ - Facilitates mocking of class. + Facilitates mocking of class. @@ -3209,6 +3728,82 @@ A value of true if file information was retrieved successfully, false otherwise. + + + Portable implementation of . + + + + + Returns details about current process and thread in a portable manner. + + + + + Initializes static members of the ThreadIDHelper class. + + + + + Gets the singleton instance of PortableThreadIDHelper or + Win32ThreadIDHelper depending on runtime environment. + + The instance. + + + + Gets current thread ID. + + + + + Gets current process ID. + + + + + Gets current process name. + + + + + Gets current process name (excluding filename extension, if any). + + + + + Initializes a new instance of the class. + + + + + Gets the name of the process. + + + + + Gets current thread ID. + + + + + + Gets current process ID. + + + + + + Gets current process name. + + + + + + Gets current process name (excluding filename extension, if any). + + + Reflection helpers for accessing properties. @@ -3299,43 +3894,6 @@ The next item in the chain. - - - Returns details about current process and thread in a portable manner. - - - - - Initializes static members of the ThreadIDHelper class. - - - - - Gets the singleton instance of PortableThreadIDHelper or - Win32ThreadIDHelper depending on runtime environment. - - The instance. - - - - Gets current thread ID. - - - - - Gets current process ID. - - - - - Gets current process name. - - - - - Gets current process name (excluding filename extension, if any). - - Wraps with a timeout. @@ -3364,6 +3922,23 @@ URL Encoding helper. + + + Win32-optimized implementation of . + + + + + Gets the information about a file. + + Name of the file. + The file handle. + The last write time of the file. + Length of the file. + + A value of true if file information was retrieved successfully, false otherwise. + + Win32-optimized implementation of . @@ -3409,9 +3984,9 @@ Ambient property name. - + - The current application domain's base directory. + ASP Application variable. @@ -3489,6 +4064,84 @@ Gets the logging configuration this target is part of. + + + Renders the specified ASP Application variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the ASP Application variable name. + + + + + + ASP Request variable. + + + + + Renders the specified ASP Request variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the item name. The QueryString, Form, Cookies, or ServerVariables collection variables having the specified name are rendered. + + + + + + Gets or sets the QueryString variable to be rendered. + + + + + + Gets or sets the form variable to be rendered. + + + + + + Gets or sets the cookie to be rendered. + + + + + + Gets or sets the ServerVariables item to be rendered. + + + + + + ASP Session variable. + + + + + Renders the specified ASP Session variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the session variable name. + + + + + + The current application domain's base directory. + + Initializes a new instance of the class. @@ -3513,6 +4166,52 @@ + + + The call site (class name, method name and source information). + + + + + Initializes a new instance of the class. + + + + + Renders the call site and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets a value indicating whether to render the class name. + + + + + + Gets or sets a value indicating whether to render the method name. + + + + + + Gets or sets a value indicating whether to render the source file name and line number. + + + + + + Gets or sets a value indicating whether to include source file path. + + + + + + Gets the level of stack trace information required by the implementing class. + + A counter value (increases on each layout rendering). @@ -3577,6 +4276,24 @@ + + + The environment variable. + + + + + Renders the specified environment variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the name of the environment variable. + + + Log event context data. @@ -3657,6 +4374,29 @@ The encoding. + + + The information about the garbage collector. + + + + + Initializes a new instance of the class. + + + + + Renders the selected process information. + + The to append the rendered data to. + Logging event. + + + + Gets or sets the property to retrieve. + + + Gets or sets the property of System.GC to retrieve. @@ -3733,6 +4473,55 @@ + + + Thread identity information (name and authentication information). + + + + + Initializes a new instance of the class. + + + + + Renders the specified identity information and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the separator to be used when concatenating + parts of identity information. + + + + + + Gets or sets a value indicating whether to render Thread.CurrentPrincipal.Identity.Name. + + + + + + Gets or sets a value indicating whether to render Thread.CurrentPrincipal.Identity.AuthenticationType. + + + + + + Gets or sets a value indicating whether to render Thread.CurrentPrincipal.Identity.IsAuthenticated. + + + + + + Gets or sets a value indicating whether to modify the output of this renderer so it can be used as a part of file path + (illegal characters are replaced with '_'). + + + Installation parameter (passed to InstallNLogConfig). @@ -3843,6 +4632,18 @@ + + + Gets or sets a value indicating whether to include call site (class and method name) in the information sent over the network. + + + + + + Gets or sets a value indicating whether to include source info (file name and line number) in the information sent over the network. + + + Gets or sets a value indicating whether to include contents of the dictionary. @@ -3890,6 +4691,23 @@ The to append the rendered data to. Logging event. + + + The machine name that the process is running on. + + + + + Initializes the layout renderer. + + + + + Renders the machine name and appends it to the specified . + + The to append the rendered data to. + Logging event. + Mapped Diagnostic Context item. Provided for compatibility with log4net. @@ -3996,6 +4814,52 @@ + + + The performance counter. + + + + + Initializes the layout renderer. + + + + + Closes the layout renderer. + + + + + Renders the specified environment variable and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the name of the counter category. + + + + + + Gets or sets the name of the performance counter. + + + + + + Gets or sets the name of the performance counter instance (e.g. this.Global_). + + + + + + Gets or sets the name of the machine to read the performance counter from. + + + The identifier of the current process. @@ -4008,6 +4872,239 @@ The to append the rendered data to. Logging event. + + + The information about the running process. + + + + + Initializes a new instance of the class. + + + + + Initializes the layout renderer. + + + + + Closes the layout renderer. + + + + + Renders the selected process information. + + The to append the rendered data to. + Logging event. + + + + Gets or sets the property to retrieve. + + + + + + Property of System.Diagnostics.Process to retrieve. + + + + + Base Priority. + + + + + Exit Code. + + + + + Exit Time. + + + + + Process Handle. + + + + + Handle Count. + + + + + Whether process has exited. + + + + + Process ID. + + + + + Machine name. + + + + + Handle of the main window. + + + + + Title of the main window. + + + + + Maximum Working Set. + + + + + Minimum Working Set. + + + + + Non-paged System Memory Size. + + + + + Non-paged System Memory Size (64-bit). + + + + + Paged Memory Size. + + + + + Paged Memory Size (64-bit).. + + + + + Paged System Memory Size. + + + + + Paged System Memory Size (64-bit). + + + + + Peak Paged Memory Size. + + + + + Peak Paged Memory Size (64-bit). + + + + + Peak Vitual Memory Size. + + + + + Peak Virtual Memory Size (64-bit).. + + + + + Peak Working Set Size. + + + + + Peak Working Set Size (64-bit). + + + + + Whether priority boost is enabled. + + + + + Priority Class. + + + + + Private Memory Size. + + + + + Private Memory Size (64-bit). + + + + + Privileged Processor Time. + + + + + Process Name. + + + + + Whether process is responding. + + + + + Session ID. + + + + + Process Start Time. + + + + + Total Processor Time. + + + + + User Processor Time. + + + + + Virtual Memory Size. + + + + + Virtual Memory Size (64-bit). + + + + + Working Set Size. + + + + + Working Set Size (64-bit). + + The name of the current process. @@ -4170,6 +5267,110 @@ Whether application is running with elevated permissions. + + + System special folder path (includes My Documents, My Music, Program Files, Desktop, and more). + + + + + Renders the directory where NLog is located and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the system special folder to use. + + + Full list of options is available at MSDN. + The most common ones are: +
    +
  • ApplicationData - roaming application data for current user.
  • +
  • CommonApplicationData - application data for all users.
  • +
  • MyDocuments - My Documents
  • +
  • DesktopDirectory - Desktop directory
  • +
  • LocalApplicationData - non roaming application data
  • +
  • Personal - user profile directory
  • +
  • System - System directory
  • +
+
+ +
+ + + Gets or sets the name of the file to be Path.Combine()'d with the directory name. + + + + + + Gets or sets the name of the directory to be Path.Combine()'d with the directory name. + + + + + + Format of the ${stacktrace} layout renderer output. + + + + + Raw format (multiline - as returned by StackFrame.ToString() method). + + + + + Flat format (class and method names displayed in a single line). + + + + + Detailed flat format (method signatures displayed in a single line). + + + + + Stack trace renderer. + + + + + Initializes a new instance of the class. + + + + + Renders the call site and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets the output format of the stack trace. + + + + + + Gets or sets the number of top stack frames to be rendered. + + + + + + Gets or sets the stack frame separator string. + + + + + + Gets the level of stack trace information required by the implementing class. + + + A temporary directory. @@ -4230,6 +5431,35 @@ The to append the rendered data to. Logging event. + + + Thread Windows identity information (username). + + + + + Initializes a new instance of the class. + + + + + Renders the current thread windows identity information and appends it to the specified . + + The to append the rendered data to. + Logging event. + + + + Gets or sets a value indicating whether domain name should be included. + + + + + + Gets or sets a value indicating whether username should be included. + + + Applies caching to another layout output. @@ -4477,7 +5707,7 @@ The text to be post-processed. Trimmed string. - + Gets or sets a value indicating whether lower case conversion should be applied. @@ -5085,6 +6315,13 @@ String representation of the log event. + + + Sets the stack trace for the event info. + + The stack trace. + Index of the first user stack frame within the stack trace. + Gets the unique identifier of log event which is automatically generated @@ -5101,6 +6338,27 @@ Gets or sets the level of the logging event. + + + Gets a value indicating whether stack trace has been set for this event. + + + + + Gets the stack frame of the method that did the logging. + + + + + Gets the number index of the stack frame that represents the user + code (not the NLog code). + + + + + Gets the entire stack trace. + + Gets or sets the exception information. @@ -5174,6 +6432,23 @@ Null logger instance. + + + Gets the logger named after the currently-being-initialized class. + + The logger. + This is a slow-running method. + Make sure you're not doing this in a loop. + + + + Gets the logger named after the currently-being-initialized class. + + The type of the logger to create. The type must inherit from NLog.Logger. + The logger. + This is a slow-running method. + Make sure you're not doing this in a loop. + Gets the specified named logger. @@ -5267,6 +6542,11 @@ Occurs when logging changes. + + + Occurs when logging gets reloaded. + + Gets or sets a value indicating whether exceptions should be thrown. @@ -5335,6 +6615,14 @@ The logger name. An instance of . + + + Gets the logger named after the currently-being-initialized class. + + The logger. + This is a slow-running method. + Make sure you're not doing this in a loop. + Provides logging interface and utility functions. @@ -8024,11 +9312,33 @@ Creates and manages instances of objects. + + + Initializes static members of the LogManager class. + + Prevents a default instance of the LogManager class from being created. + + + Gets the logger named after the currently-being-initialized class. + + The logger. + This is a slow-running method. + Make sure you're not doing this in a loop. + + + + Gets the logger named after the currently-being-initialized class. + + The logger class. The class must inherit from . + The logger. + This is a slow-running method. + Make sure you're not doing this in a loop. + Creates a logger that discards all log messages. @@ -8121,6 +9431,11 @@ Occurs when logging changes. + + + Occurs when logging gets reloaded. + + Gets or sets a value indicating whether NLog should throw exceptions. @@ -8166,6 +9481,22 @@ The result. + + + Log Receiver Client Channel. + + + + + Service contract for Log Receiver server. + + + + + Processes the log messages. + + The events. + Internal configuration of Log Receiver Service contracts. @@ -8277,40 +9608,6 @@ The events. - - - Log Receiver Client using legacy SOAP client. - - - - - Initializes a new instance of the class. - - The service URL. - - - - Processes the log messages. - - The events. - - - - Begins processing of log messages. - - The events. - The callback. - Asynchronous state. - - IAsyncResult value which can be passed to . - - - - - Ends asynchronous processing of log messages. - - The result. - List of strings annotated for more terse serialization. @@ -8321,6 +9618,110 @@ Initializes a new instance of the class. + + + Log Receiver Client using WCF. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Name of the endpoint configuration. + + + + Initializes a new instance of the class. + + Name of the endpoint configuration. + The remote address. + + + + Initializes a new instance of the class. + + Name of the endpoint configuration. + The remote address. + + + + Initializes a new instance of the class. + + The binding. + The remote address. + + + + Opens the client asynchronously. + + + + + Opens the client asynchronously. + + User-specific state. + + + + Closes the client asynchronously. + + + + + Closes the client asynchronously. + + User-specific state. + + + + Processes the log messages asynchronously. + + The events to send. + + + + Processes the log messages asynchronously. + + The events to send. + User-specific state. + + + + Begins processing of log messages. + + The events to send. + The callback. + Asynchronous state. + + IAsyncResult value which can be passed to . + + + + + Ends asynchronous processing of log messages. + + The result. + + + + Occurs when the log message processing has completed. + + + + + Occurs when Open operation has completed. + + + + + Occurs when Close operation has completed. + + Mapped Diagnostics Context - a thread-local structure that keeps a dictionary @@ -8509,6 +9910,19 @@ The message. The inner exception. + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + The parameter is null. + + + The class name is null or is zero (0). + + Exception thrown during log event processing. @@ -8532,6 +9946,19 @@ The message. The inner exception. + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + The parameter is null. + + + The class name is null or is zero (0). + + TraceListener which routes all messages through NLog. @@ -8577,6 +10004,81 @@ Flushes the output buffer. + + + Writes trace information, a data object and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + The trace data to emit. + + + + Writes trace information, an array of data objects and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + An array of objects to emit as data. + + + + Writes trace and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + + + + Writes trace information, a formatted array of objects and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + A format string that contains zero or more format items, which correspond to objects in the array. + An object array containing zero or more objects to format. + + + + Writes trace information, a message, and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + One of the values specifying the type of event that has caused the trace. + A numeric identifier for the event. + A message to write. + + + + Writes trace information, a message, a related activity identity and event information to the listener specific output. + + A object that contains the current process ID, thread ID, and stack trace information. + A name used to identify the output, typically the name of the application that generated the trace event. + A numeric identifier for the event. + A message to write. + A object identifying a related activity. + + + + Gets the custom attributes supported by the trace listener. + + + A string array naming the custom attributes supported by the trace listener, or null if there are no custom attributes. + + + + + Translates the event type to level from . + + Type of the event. + Translated log level. + Gets or sets the log factory to use when outputting messages (null - use LogManager). @@ -8592,6 +10094,18 @@ Gets or sets the log which should be always used regardless of source level. + + + Gets a value indicating whether the trace listener is thread safe. + + + true if the trace listener is thread safe; otherwise, false. The default is false. + + + + Gets or sets a value indicating whether to use auto logger name detected from the stack trace. + + Specifies the way archive numbering is performed. @@ -8607,98 +10121,11 @@ Rolling style numbering (the most recent is always #0 then #1, ..., #N. - + - Sends log messages to the remote instance of Chainsaw application from log4j. + Outputs log messages through the ASP Response object. - Documentation on NLog Wiki - -

- To set up the target in the configuration file, - use the following syntax: -

- -

- This assumes just one target and a single rule. More configuration - options are described here. -

-

- To set up the log target programmatically use code like this: -

- -

- NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -

-
-
- - - Sends log messages to the remote instance of NLog Viewer. - - Documentation on NLog Wiki - -

- To set up the target in the configuration file, - use the following syntax: -

- -

- This assumes just one target and a single rule. More configuration - options are described here. -

-

- To set up the log target programmatically use code like this: -

- -

- NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -

-
-
- - - Sends log messages over the network. - - Documentation on NLog Wiki - -

- To set up the target in the configuration file, - use the following syntax: -

- -

- This assumes just one target and a single rule. More configuration - options are described here. -

-

- To set up the log target programmatically use code like this: -

- -

- To print the results, use any application that's able to receive messages over - TCP or UDP. NetCat is - a simple but very powerful command-line tool that can be used for that. This image - demonstrates the NetCat tool receiving log messages from Network target. -

- -

- NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -

-

- There are two specialized versions of the Network target: Chainsaw - and NLogViewer which write to instances of Chainsaw log4j viewer - or NLogViewer application respectively. -

-
+ Documentation on NLog Wiki
@@ -8854,6 +10281,111 @@ + + + Outputs the rendered logging event through the OutputDebugString() Win32 API. + + The logging event. + + + + Gets or sets a value indicating whether to add <!-- --> comments around all written texts. + + + + + + Sends log messages to the remote instance of Chainsaw application from log4j. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +

+ NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol + or you'll get TCP timeouts and your application will crawl. + Either switch to UDP transport or use AsyncWrapper target + so that your application threads will not be blocked by the timing-out connection attempts. +

+
+
+ + + Sends log messages to the remote instance of NLog Viewer. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +

+ NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol + or you'll get TCP timeouts and your application will crawl. + Either switch to UDP transport or use AsyncWrapper target + so that your application threads will not be blocked by the timing-out connection attempts. +

+
+
+ + + Sends log messages over the network. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +

+ To print the results, use any application that's able to receive messages over + TCP or UDP. NetCat is + a simple but very powerful command-line tool that can be used for that. This image + demonstrates the NetCat tool receiving log messages from Network target. +

+ +

+ NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol + or you'll get TCP timeouts and your application will crawl. + Either switch to UDP transport or use AsyncWrapper target + so that your application threads will not be blocked by the timing-out connection attempts. +

+

+ There are two specialized versions of the Network target: Chainsaw + and NLogViewer which write to instances of Chainsaw log4j viewer + or NLogViewer application respectively. +

+
+
Initializes a new instance of the class. @@ -8962,6 +10494,18 @@ + + + Gets or sets a value indicating whether to include call site (class and method name) in the information sent over the network. + + + + + + Gets or sets a value indicating whether to include source info (file name and line number) in the information sent over the network. + + + Gets or sets a value indicating whether to include dictionary contents. @@ -8996,26 +10540,11 @@ Initializes a new instance of the class. - + - Writes log messages to the console. + Writes log messages to the console with customizable coloring. - Documentation on NLog Wiki - -

- To set up the target in the configuration file, - use the following syntax: -

- -

- This assumes just one target and a single rule. More configuration - options are described here. -

-

- To set up the log target programmatically use code like this: -

- -
+ Documentation on NLog Wiki
@@ -9054,6 +10583,273 @@ The layout with header and footer. + + + Initializes a new instance of the class. + + + The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message} + + + + + Initializes the target. + + + + + Closes the target and releases any unmanaged resources. + + + + + Writes the specified log event to the console highlighting entries + and words based on a set of defined rules. + + Log event. + + + + Gets or sets a value indicating whether the error stream (stderr) should be used instead of the output stream (stdout). + + + + + + Gets or sets a value indicating whether to use default row highlighting rules. + + + The default rules are: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConditionForeground ColorBackground Color
level == LogLevel.FatalRedNoChange
level == LogLevel.ErrorYellowNoChange
level == LogLevel.WarnMagentaNoChange
level == LogLevel.InfoWhiteNoChange
level == LogLevel.DebugGrayNoChange
level == LogLevel.TraceDarkGrayNoChange
+
+ +
+ + + Gets the row highlighting rules. + + + + + + Gets the word highlighting rules. + + + + + + Color pair (foreground and background). + + + + + Colored console output color. + + + Note that this enumeration is defined to be binary compatible with + .NET 2.0 System.ConsoleColor + some additions + + + + + Black Color (#000000). + + + + + Dark blue Color (#000080). + + + + + Dark green Color (#008000). + + + + + Dark Cyan Color (#008080). + + + + + Dark Red Color (#800000). + + + + + Dark Magenta Color (#800080). + + + + + Dark Yellow Color (#808000). + + + + + Gray Color (#C0C0C0). + + + + + Dark Gray Color (#808080). + + + + + Blue Color (#0000FF). + + + + + Green Color (#00FF00). + + + + + Cyan Color (#00FFFF). + + + + + Red Color (#FF0000). + + + + + Magenta Color (#FF00FF). + + + + + Yellow Color (#FFFF00). + + + + + White Color (#FFFFFF). + + + + + Don't change the color. + + + + + The row-highlighting condition. + + + + + Initializes static members of the ConsoleRowHighlightingRule class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The condition. + Color of the foreground. + Color of the background. + + + + Checks whether the specified log event matches the condition (if any). + + + Log event. + + + A value of if the condition is not defined or + if it matches, otherwise. + + + + + Gets the default highlighting rule. Doesn't change the color. + + + + + Gets or sets the condition that must be met in order to set the specified foreground and background color. + + + + + + Gets or sets the foreground color. + + + + + + Gets or sets the background color. + + + + + + Writes log messages to the console. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +
+
Initializes the target. @@ -9074,6 +10870,71 @@ Note that the Error option is not supported on .NET Compact Framework. + + + Gets or sets a value indicating whether to send the log messages to the standard error instead of the standard output. + + + + + + Highlighting rule for Win32 colorful console. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The text to be matched.. + Color of the foreground. + Color of the background. + + + + Gets or sets the regular expression to be matched. You must specify either text or regex. + + + + + + Gets or sets the text to be matched. You must specify either text or regex. + + + + + + Gets or sets a value indicating whether to match whole words only. + + + + + + Gets or sets a value indicating whether to ignore case when comparing texts. + + + + + + Gets the compiled regular expression that matches either Text or Regex property. + + + + + Gets or sets the foreground color. + + + + + + Gets or sets the background color. + + + Information about database command + parameters. @@ -9267,6 +11128,12 @@ + + + Gets or sets the name of the connection string (as specified in <connectionStrings> configuration section. + + + Gets or sets the connection string. When provided, it overrides the values @@ -9359,6 +11226,42 @@ + + + Writes log messages to the attached managed debugger. + + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +
+
+ + + Initializes the target. + + + + + Closes the target and releases any unmanaged resources. + + + + + Writes the specified logging event to the attached debugger. + + The logging event. + Mock target - useful for testing. @@ -9406,6 +11309,98 @@ + + + Writes log message to the Event Log. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +
+
+ + + Initializes a new instance of the class. + + + + + Performs installation which requires administrative permissions. + + The installation context. + + + + Performs uninstallation which requires administrative permissions. + + The installation context. + + + + Determines whether the item is installed. + + The installation context. + + Value indicating whether the item is installed or null if it is not possible to determine. + + + + + Initializes the target. + + + + + Writes the specified logging event to the event log. + + The logging event. + + + + Gets or sets the name of the machine on which Event Log service is running. + + + + + + Gets or sets the layout that renders event ID. + + + + + + Gets or sets the layout that renders event Category. + + + + + + Gets or sets the value to be used as the event Source. + + + By default this is the friendly name of the current AppDomain. + + + + + + Gets or sets the name of the Event Log to write to. This can be System, Application or + any user-defined name. + + + Modes of archiving files based on time. @@ -9592,6 +11587,12 @@ + + + Gets or sets the file attributes (Windows only). + + + Gets or sets the line ending mode. @@ -9742,6 +11743,59 @@ Gets the characters that are appended after each line. + + + Logs text to Windows.Forms.Control.Text property control of specified Name. + + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ The result is: +

+ +

+ To set up the log target programmatically similar to above use code like this: +

+ , +
+
+ + + Initializes a new instance of the class. + + + The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message} + + + + + Log message to control. + + + The logging event. + + + + + Gets or sets the name of control to which NLog will log write log text. + + + + + + Gets or sets a value indicating whether log text should be appended to the text of the control instead of overwriting it. + + + + + Gets or sets the name of the Form on which the control is located. + + + Line ending mode. @@ -9805,6 +11859,19 @@ The endpoint address. + + + Gets or sets the name of the endpoint configuration in WCF configuration file. + + The name of the endpoint configuration. + + + + + Gets or sets a value indicating whether to use binary message encoding. + + + Gets or sets the client ID. @@ -9819,6 +11886,152 @@ The parameters. + + + Sends log messages by email using SMTP protocol. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +

+ Mail target works best when used with BufferingWrapper target + which lets you send multiple log messages in single mail +

+

+ To set up the buffered mail target in the configuration file, + use the following syntax: +

+ +

+ To set up the buffered mail target programmatically use code like this: +

+ +
+
+ + + Initializes a new instance of the class. + + + The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message} + + + + + Renders the logging event message and adds it to the internal ArrayList of log messages. + + The logging event. + + + + Renders an array logging events. + + Array of logging events. + + + + Gets or sets sender's email address (e.g. joe@domain.com). + + + + + + Gets or sets recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + + Gets or sets CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + + Gets or sets BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com). + + + + + + Gets or sets a value indicating whether to add new lines between log entries. + + A value of true if new lines should be added; otherwise, false. + + + + + Gets or sets the mail subject. + + + + + + Gets or sets mail message body (repeated for each log message send in one mail). + + Alias for the Layout property. + + + + + Gets or sets encoding to be used for sending e-mail. + + + + + + Gets or sets a value indicating whether to send message as HTML instead of plain text. + + + + + + Gets or sets SMTP Server to be used for sending. + + + + + + Gets or sets SMTP Authentication mode. + + + + + + Gets or sets the username used to connect to SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + + Gets or sets the password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic"). + + + + + + Gets or sets a value indicating whether SSL (secure sockets layer) should be used when communicating with SMTP server. + + + + + + Gets or sets the port number that SMTP Server is listening on. + + + Writes log messages to an ArrayList in memory for programmatic retrieval. @@ -10112,6 +12325,486 @@ + + + Outputs log messages through the OutputDebugString() Win32 API. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +
+
+ + + Outputs the rendered logging event through the OutputDebugString() Win32 API. + + The logging event. + + + + Increments specified performance counter on each write. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +
+ + TODO: + 1. Unable to create a category allowing multiple counter instances (.Net 2.0 API only, probably) + 2. Is there any way of adding new counters without deleting the whole category? + 3. There should be some mechanism of resetting the counter (e.g every day starts from 0), or auto-switching to + another counter instance (with dynamic creation of new instance). This could be done with layouts. + +
+ + + Initializes a new instance of the class. + + + + + Performs installation which requires administrative permissions. + + The installation context. + + + + Performs uninstallation which requires administrative permissions. + + The installation context. + + + + Determines whether the item is installed. + + The installation context. + + Value indicating whether the item is installed or null if it is not possible to determine. + + + + + Increments the configured performance counter. + + Log event. + + + + Closes the target and releases any unmanaged resources. + + + + + Ensures that the performance counter has been initialized. + + True if the performance counter is operational, false otherwise. + + + + Gets or sets a value indicating whether performance counter should be automatically created. + + + + + + Gets or sets the name of the performance counter category. + + + + + + Gets or sets the name of the performance counter. + + + + + + Gets or sets the performance counter instance name. + + + + + + Gets or sets the counter help text. + + + + + + Gets or sets the performance counter type. + + + + + + The row-coloring condition. + + + + + Initializes static members of the RichTextBoxRowColoringRule class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The condition. + Color of the foregroung text. + Color of the background text. + The font style. + + + + Initializes a new instance of the class. + + The condition. + Color of the text. + Color of the background. + + + + Checks whether the specified log event matches the condition (if any). + + + Log event. + + + A value of if the condition is not defined or + if it matches, otherwise. + + + + + Gets the default highlighting rule. Doesn't change the color. + + + + + + Gets or sets the condition that must be met in order to set the specified font color. + + + + + + Gets or sets the font color. + + + Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed. + + + + + + Gets or sets the background color. + + + Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed. + + + + + + Gets or sets the font style of matched text. + + + Possible values are the same as in FontStyle enum in System.Drawing + + + + + + Log text a Rich Text Box control in an existing or new form. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ The result is: +

+ To set up the target with coloring rules in the configuration file, + use the following syntax: +

+ + + +

+ The result is: +

+ To set up the log target programmatically similar to above use code like this: +

+ + , + + + for RowColoring, + + + for WordColoring +
+
+ + + Initializes static members of the RichTextBoxTarget class. + + + The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message} + + + + + Initializes a new instance of the class. + + + The default value of the layout is: ${longdate}|${level:uppercase=true}|${logger}|${message} + + + + + Initializes the target. Can be used by inheriting classes + to initialize logging. + + + + + Closes the target and releases any unmanaged resources. + + + + + Log message to RichTextBox. + + The logging event. + + + + Gets the default set of row coloring rules which applies when is set to true. + + + + + Gets or sets the Name of RichTextBox to which Nlog will write. + + + + + + Gets or sets the name of the Form on which the control is located. + If there is no open form of a specified name than NLog will create a new one. + + + + + + Gets or sets a value indicating whether to use default coloring rules. + + + + + + Gets the row coloring rules. + + + + + + Gets the word highlighting rules. + + + + + + Gets or sets a value indicating whether the created window will be a tool window. + + + This parameter is ignored when logging to existing form control. + Tool windows have thin border, and do not show up in the task bar. + + + + + + Gets or sets a value indicating whether the created form will be initially minimized. + + + This parameter is ignored when logging to existing form control. + + + + + + Gets or sets the initial width of the form with rich text box. + + + This parameter is ignored when logging to existing form control. + + + + + + Gets or sets the initial height of the form with rich text box. + + + This parameter is ignored when logging to existing form control. + + + + + + Gets or sets a value indicating whether scroll bar will be moved automatically to show most recent log entries. + + + + + + Gets or sets the maximum number of lines the rich text box will store (or 0 to disable this feature). + + + After exceeding the maximum number, first line will be deleted. + + + + + + Gets or sets the form to log to. + + + + + Gets or sets the rich text box to log to. + + + + + Highlighting rule for Win32 colorful console. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The text to be matched.. + Color of the text. + Color of the background. + + + + Initializes a new instance of the class. + + The text to be matched.. + Color of the text. + Color of the background. + The font style. + + + + Gets or sets the regular expression to be matched. You must specify either text or regex. + + + + + + Gets or sets the text to be matched. You must specify either text or regex. + + + + + + Gets or sets a value indicating whether to match whole words only. + + + + + + Gets or sets a value indicating whether to ignore case when comparing texts. + + + + + + Gets or sets the font style of matched text. + Possible values are the same as in FontStyle enum in System.Drawing. + + + + + + Gets the compiled regular expression that matches either Text or Regex property. + + + + + Gets or sets the font color. + Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed. + + + + + + Gets or sets the background color. + Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed. + + + + + + SMTP authentication modes. + + + + + No authentication. + + + + + Basic - username and password. + + + + + NTLM Authentication. + + Marks class as a logging target and assigns a name to it. @@ -10133,6 +12826,36 @@ Gets or sets a value indicating whether to the target is a compound target (used to generate the target summary documentation page). + + + Sends log messages through System.Diagnostics.Trace. + + Documentation on NLog Wiki + +

+ To set up the target in the configuration file, + use the following syntax: +

+ +

+ This assumes just one target and a single rule. More configuration + options are described here. +

+

+ To set up the log target programmatically use code like this: +

+ +
+
+ + + Writes the specified logging event to the facility. + If the log level is greater than or equal to it uses the + method, otherwise it uses + method. + + The logging event. + Web service protocol. @@ -10219,6 +12942,95 @@ + + + Win32 file attributes. + + + For more information see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp. + + + + + Read-only file. + + + + + Hidden file. + + + + + System file. + + + + + File should be archived. + + + + + Device file. + + + + + Normal file. + + + + + File is temporary (should be kept in cache and not + written to disk if possible). + + + + + Sparse file. + + + + + Reparse point. + + + + + Compress file contents. + + + + + File should not be indexed by the content indexing service. + + + + + Encrypted file. + + + + + The system writes through any intermediate cache and goes directly to disk. + + + + + The system opens a file with no system caching. + + + + + Delete file after it is closed. + + + + + A file is accessed according to POSIX rules. + + Asynchronous request queue. @@ -10437,6 +13249,11 @@ Discard the overflowing item. + + + Block until there's more room in the queue. + + Causes a flush after each write on a wrapped target. @@ -10715,6 +13532,112 @@ + + + Impersonates another user for the duration of the write. + + Documentation on NLog Wiki + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The wrapped target. + + + + Initializes the impersonation context. + + + + + Closes the impersonation context. + + + + + Changes the security context, forwards the call to the .Write() + and switches the context back to original. + + The log event. + + + + Changes the security context, forwards the call to the .Write() + and switches the context back to original. + + Log events. + + + + Flush any pending log messages (in case of asynchronous targets). + + The asynchronous continuation. + + + + Gets or sets username to change context to. + + + + + + Gets or sets the user account password. + + + + + + Gets or sets Windows domain name to change context to. + + + + + + Gets or sets the Logon Type. + + + + + + Gets or sets the type of the logon provider. + + + + + + Gets or sets the required impersonation level. + + + + + + Gets or sets a value indicating whether to revert to the credentials of the process instead of impersonating another user. + + + + + + Helper class which reverts the given + to its original value as part of . + + + + + Initializes a new instance of the class. + + The windows impersonation context. + + + + Reverts the impersonation context. + + Logon provider. diff --git a/NzbDrone.Core/Main.cs b/NzbDrone.Core/Main.cs index 8e22872a1..4e193891b 100644 --- a/NzbDrone.Core/Main.cs +++ b/NzbDrone.Core/Main.cs @@ -1,11 +1,13 @@ using System; using System.IO; using System.Web; -using log4net; using Ninject; +using NLog.Config; +using NLog.Targets; using NzbDrone.Core.Providers; using SubSonic.DataProviders; using SubSonic.Repository; +using NLog; namespace NzbDrone.Core { @@ -20,13 +22,50 @@ namespace NzbDrone.Core kernel.Bind().To(); kernel.Bind().To(); kernel.Bind().To(); - kernel.Bind().ToMethod(c => LogManager.GetLogger("logger-name")); + kernel.Bind().ToMethod(c => log4net.LogManager.GetLogger("logger-name")); kernel.Bind().ToMethod(c => new SimpleRepository(provider, SimpleRepositoryOptions.RunMigrations)); } public static String AppPath { - get { return new DirectoryInfo(HttpContext.Current.Server.MapPath("\\")).Parent.FullName; } + get { return new DirectoryInfo(HttpContext.Current.Server.MapPath("\\")).FullName; } + } + + + public static void ConfigureNlog() + { + // Step 1. Create configuration object + var config = new LoggingConfiguration(); + + // Step 2. Create targets and add them to the configuration + var consoleTarget = new DebuggerTarget(); + config.AddTarget("console", consoleTarget); + + FileTarget fileTarget = new FileTarget(); + config.AddTarget("file", fileTarget); + + // Step 3. Set target properties + consoleTarget.Layout = "${logger} ${message}"; + fileTarget.FileName = "${basedir}/test.log"; + fileTarget.Layout = "${message}"; + + // Step 4. Define rules + LoggingRule rule1 = new LoggingRule("*", LogLevel.Trace, consoleTarget); + config.LoggingRules.Add(rule1); + + LoggingRule rule2 = new LoggingRule("*", LogLevel.Trace, fileTarget); + config.LoggingRules.Add(rule2); + + // Step 5. Activate the configuration + NLog.LogManager.Configuration = config; + + Logger logger = LogManager.GetCurrentClassLogger(); + logger.Trace("trace log message"); + logger.Debug("debug log message"); + logger.Info("info log message"); + logger.Warn("warn log message"); + logger.Error("error log message"); + logger.Fatal("fatal log message"); } } } \ No newline at end of file diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 87cb933e7..a13ed8a78 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -10,7 +10,7 @@ Properties NzbDrone.Core NzbDrone.Core - v3.5 + v4.0 512 @@ -128,6 +128,10 @@ + + False + Libraries\NLog.Extended.dll + False Libraries\SubSonic.Core.dll @@ -136,7 +140,7 @@ - + @@ -193,7 +197,6 @@ - @@ -202,6 +205,9 @@ + + + @@ -212,9 +218,6 @@ - - - + + + Use it to configure Data binding. + + Action that configures the data binding options. + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .DataBinding(dataBinding => dataBinding + .Ajax().Select("_AjaxLoading", "ComboBox") + ); + %> + + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => + events.OnLoad("onLoad") + ) + %> + + + + + + Configures the effects of the AutoComplete. + + The action which configures the effects. + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .Effects(fx => + { + fx.Slide() + .OpenDuration(AnimationDuration.Normal) + .CloseDuration(AnimationDuration.Normal); + }) + + + + + + Use it to configure filtering settings. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(filtering => filtering.Enabled(true) + .FilterMode(AutoCompleteFilterMode.Contains)); + %> + + + + + + Use it to enable multiple values. + + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .Multiple(); + %> + + + + + + Use it to configure autocompleting multiple values. + + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .Multiple(multi => multi.Enabled(true) + .Separator(" ")); + %> + + + + + + Use it to enable highlighting of first matched item. + + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .HighlightFirstMatch(true) + %> + + + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Enable or disable autocompleting multiple values into a single field + + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .Multiple(multi => + { + multi.Enabled((bool)ViewData["multiple"]); + }) + %> + + + + + + Set multiple values separator. + + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .Multiple(multi => + { + multi.Separator(", "); + }) + %> + + + + + + Gets the items of the ComboBox. + + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables filtering. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(filtering => + { + filtering.Enabled((bool)ViewData["filtering"]); + }) + %> + + + + The Enabled method is useful when you need to enable/disable filtering based on certain conditions. + + + + + Defines filter mode. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(filtering => + { + filtering.FilterMode(AutoCompleteFilterMode.StartsWith); + }) + %> + + + + + + Set minimum chars number needed to start filtering. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(filtering => + { + filtering.MinimumChars(2); + }) + %> + + + + + + Defines the fluent interface for configuring the component. + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => + events.OnLoad("onLoad") + ) + %> + + + + + + Configures the effects of the dropdownlist. + + The action which configures the effects. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .Effects(fx => + { + fx.Slide() + .OpenDuration(AnimationDuration.Normal) + .CloseDuration(AnimationDuration.Normal); + }) + + + + + + Defines the items in the DropDownList + + The add action. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + + + Initializes a new instance of the class. + + The component. + + + + Use it to enable filtering of items. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(); + %> + + + + + + Use it to configure filtering settings. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(filtering => filtering.Enabled(true) + .FilterMode(AutoCompleteFilterMode.Contains)); + %> + + + + + + Use it to enable filling the first matched item text. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .AutoFill(true) + %> + + + + + + Use it to configure Data binding. + + Action that configures the data binding options. + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .DataBinding(dataBinding => dataBinding + .Ajax().Select("_AjaxLoading", "ComboBox") + ); + %> + + + + + + Use it to enable highlighting of first matched item. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .HighlightFirstMatch(true) + %> + + + + + + Use it to set selected item index + + Item index. + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .SelectedIndex(0); + %> + + + + + + Defines the fluent interface for building + + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables binding. + + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home").Enabled((bool)ViewData["ajax"]); + }) + %> + + + + The Enabled method is useful when you need to enable binding based on certain conditions. + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home", new { {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home"); + }) + %> + + + + + + Sets the route and values for the select operation + + Name of the route. + The route values. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the route and values for the select operation + + Name of the route. + The route values. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default", new {id=1}); + }) + %> + + + + + + Sets the route name for the select operation + + Name of the route. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default"); + }) + %> + + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables cache of items. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home").Cache((bool)ViewData["cache"]); + }) + %> + + + + The Cache method is useful when you need to enable/disable caching based on certain conditions. + Default value is true. + + + + + Specifies delay of the Ajax/WebServer request. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home").Delay(400); + }) + %> + + + + The Delay method is useful when you need to postpone request to the server for some time. + + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Defines filter mode. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(filtering => + { + filtering.FilterMode(AutoCompleteFilterMode.StartsWith); + }) + %> + + + + + + Set minimum chars number needed to start filtering. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Filterable(filtering => + { + filtering.MinimumChars(2); + }) + %> + + + + + + Defines the fluent interface for configuring the data binding. + + + + + Initializes a new instance of the class. + + The configuration. + + + + Use it to configure Ajax binding. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .DataBinding(dataBinding => dataBinding + .Ajax().Select("_AjaxLoading", "TreeView") + ) + %> + + + + + + Use it to configure web service binding. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .DataBinding(dataBinding => dataBinding + .WebService().Select("~/Models/ProductDDI.asmx/GetProducts") + ) + %> + + + + + + Defines the fluent interface for building + + + + + Defines the fluent interface for configuring the treeview webservice. + + + + + Initializes a new instance of the class. + + The settings. + + + + Specify the web service url for loading data + + The web service url + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => dataBinding + .WebService().Select("~/Models/ProductDDI.asmx/GetProducts") + ) + %> + + + + + + Enables / disables web service functionality. + + Whether to enable or to disable the web service. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => dataBinding + .Ajax().Enabled(true).Select("_AjaxLoading", "DropDownList") + ) + %> + + + + The Enabled method is useful when you need to enable ajax based on certain conditions. + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables cache of items. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .DataBinding(dataBinding => + { + dataBinding.WebService().Select("~/Models/Product.asmx/GetProducts").Cache((bool)ViewData["cache"]); + }) + %> + + + + The Cache method is useful when you need to enable/disable caching based on certain conditions. + Default value is true. + + + + + Specifies delay of the Ajax/WebServer request. + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .DataBinding(dataBinding => + { + dataBinding.WebService().Select("~/Models/Product.asmx/GetProducts").Delay(400); + }) + %> + + + + The Delay method is useful when you need to postpone request to the server for some time. + + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Defines the fluent interface for configuring the treeview webservice. + + + + + Initializes a new instance of the class. + + The settings. + + + + Represent item in the DropDownList/ComboBox items. + + + + + Gets the items of the treeview. + + + + + Use it to set selected item index + + Item index. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .SelectedIndex(0); + %> + + + + + + Use it to configure Data binding. + + Action that configures the data binding options. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => dataBinding + .Ajax().Select("_AjaxLoading", "DropDownList") + ); + %> + + + + + + Initializes a new instance of the class. + + The client events. + The view context. + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the inline handler of the OnChange client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnChange(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnChange client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnChange("onChange")) + %> + + + + + + Defines the inline handler of the OnOpen client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnOpen(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnOpen client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnOpen("onOpen")) + %> + + + + + + Defines the inline handler of the OnClose client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnClose(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnClose client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnClose("onClose")) + %> + + + + + + Defines the inline handler of the OnDataBinding client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnDataBinding(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDataBinding client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnDataBinding("OnDataBinding")) + %> + + + + + + Defines the inline handler of the OnDataBound client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnDataBound(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDataBound client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnDataBound("onDataBound")) + %> + + + + + + Defines the inline handler of the OnError client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnError(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnError client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .ClientEvents(events => events.OnError("onError")) + %> + + + + + + Defines the fluent interface for configuring the data binding. + + + + + Initializes a new instance of the class. + + The configuration. + + + + Use it to configure Ajax binding. + + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => dataBinding + .Ajax().Select("_AjaxLoading", "TreeView") + ) + %> + + + + + + Use it to configure web service binding. + + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .DataBinding(dataBinding => dataBinding + .WebService().Select("~/Models/ProductDDI.asmx/GetProducts") + ) + %> + + + + + + Defines the fluent interface for configuring child DropDonwList items. + + + + + Initializes a new instance of the class. + + The item. + + + + Sets the value for the item. + + The value. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .Items(items => items.Add().Text("First item.")) + %> + + + + + + Sets the value for the item. + + The value. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .Items(items => items.Add().Value("1")) + %> + + + + + + Define when the item will be expanded on intial render. + + If true the item will be selected. + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .Items(items => + { + items.Add().Text("First Item").Selected(true); + }) + %> + + + + + + Creates items for the . + + + + + Initializes a new instance of the class. + + The settings. + + + + Defines a item. + + + + + + Defines an interface that supports navigation. + + + + + Gets or sets the name of the route. + + The name of the route. + + + + Gets or sets the name of the controller. + + The name of the controller. + + + + Gets or sets the name of the action. + + The name of the action. + + + + Gets the route values. + + The route values. + + + + Gets or sets the URL. + + The URL. + + + + Sets the HTML content that will show initially in the editor. + + The action which renders the HTML content. + + <% Html.Telerik().Editor() + .Name("Editor") + .Value(() => { %> + <blockquote> + According to Deep Thought, the answer to the ultimate question of + life, the universe and everything is <strong>42</strong>. + </blockquote> + <% }) + .Render(); + %> + + + + + Sets the HTML content which the item should display as a string. + + An HTML string. + + <%= Html.Telerik().Editor() + .Name("Editor") + .Value("<blockquote>A towel has <strong>immense</strong> psychological value</blockquote>") + %> + + + + + Encode HTML content. + + + <%= Html.Telerik().Editor() + .Name("Editor") + .Value("<blockquote>A towel has <strong>immense</strong> psychological value</blockquote>") + .Encode(true) + %> + + + + + Sets the localization culture of the editor. + + The culture. + + + <%= Html.Telerik().Editor() + .Name("Editor") + .Value("<blockquote>A towel has <strong>immense</strong> psychological value</blockquote>") + .Localizable("de-DE") + %> + + + + + + Enables toggle animation. + + + + + Enables opacity animation. + + + + + Enables opacity animation. + + Builder, which sets different opacity properties. + + + + Enables expand animation. + + + + + Enables expand animation. + + Builder, which sets different expand properties. + + + + Enables slide animation. + + + + + Enables slide animation. + + Builder, which sets different slide properties. + + + + Defines the fluent interface for configuring grid editing. + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables grid editing. + + + + <%= Html.Telerik().Grid<Order>() + .Name("Orders") + .Editable(settings => settings.Enabled(true)) + %> + + + + The Enabled method is useful when you need to enable grid editing on certain conditions. + + + + + Enables or disables delete confirmation. + + + + <%= Html.Telerik().Grid<Order>() + .Name("Orders") + .Editable(settings => settings.DisplayDeleteConfirmation(true)) + %> + + + + The Enabled method is useful when you need to enable grid editing on certain conditions. + + + + + Defines the fluent interface for configuring template columns + + + + + Defines the fluent interface for configuring columns. + + + The type of the column builder. + + + + Initializes a new instance of the class. + + The column. + + + + Sets the title displayed in the header of the column. + + The text. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderID).Title("ID")) + %> + + + + + + Sets the HTML attributes applied to the header cell of the column. + + The attributes. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderID).HeaderHtmlAttributes(new {@class="order-header"})) + %> + + + + + + Sets the HTML attributes applied to the content cell of the column. + + The attributes. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderID).HtmlAttributes(new {@class="order-cell"})) + %> + + + + + + Sets the width of the column in pixels. + + The width in pixels. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderID).Width(100)) + %> + + + + + + Sets the width of the column. + + The width to set. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => + { + %> + <%= Html.ActionLink("Edit", "Home", new { id = o.OrderID}) %> + <% + }) + .Render(); + %> + + + + + + Makes the column visible or not. By default all columns are visible. Invisible columns are not rendered in the output HTML. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderID).Visible((bool)ViewData["visible"])) + %> + + + + + + Makes the column hidden or not. By default all columns are not hidden. Hidden columns are rendered in the output HTML but are hidden. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderID).Hidden((bool)ViewData["hidden"])) + %> + + + + + + Hides a column. By default all columns are not hidden. Hidden columns are rendered in the output HTML but are hidden. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderID).Hidden()) + %> + + + + + + Gets or sets the column. + + The column. + + + + Sets the button type. + + The button type. + + + + + Sets the HTML attributes. + + The HTML attributes. + + + + + Sets the image HTML attributes. + + The Image HTML attributes. + + + + + Gets or sets a value indicating whether member access expression used + by this builder should be lifted to null. The default value is true; + + + true if member access should be lifted to null; otherwise, false. + + + + Provided expression should have string type + + + ArgumentException. + + + ArgumentException. + + + + Provided 's is not + + + + Provided type is not + + + + Provided 's is not + + + + + Provided 's is not + + + + + + + + ArgumentException. + + + did not implement . + + + + Invalid name for property or field; or indexer with the specified arguments. + + + + InvalidOperationException. + + + InvalidCastException. + + + + Holds extension methods for . + + + + + Child element with name specified by does not exists. + + + + + Represents a filtering descriptor which serves as a container for one or more child filtering descriptors. + + + + + Base class for all used for + handling the logic for property changed notifications. + + + + + Represents a filtering abstraction that knows how to create predicate filtering expression. + + + + + Creates a predicate filter expression used for collection filtering. + + The instance expression, which will be used for filtering. + A predicate filter expression. + + + + Creates a filter expression by delegating its creation to + , if + is , otherwise throws + + The instance expression, which will be used for filtering. + A predicate filter expression. + Parameter should be of type + + + + Creates a predicate filter expression used for collection filtering. + + The parameter expression, which will be used for filtering. + A predicate filter expression. + + + + Creates a predicate filter expression combining + expressions with . + + The parameter expression, which will be used for filtering. + A predicate filter expression. + + + + Gets or sets the logical operator used for composing of . + + The logical operator used for composition. + + + + Gets or sets the filter descriptors that will be used for composition. + + The filter descriptors used for composition. + + + + Logical operator used for filter descriptor composition. + + + + + Combines filters with logical AND. + + + + + Combines filters with logical OR. + + + + + The class enables implementation of custom filtering logic. + + + + + The method checks whether the passed parameter satisfies filter criteria. + + + + + Creates a predicate filter expression that calls . + + The parameter expression, which parameter + will be passed to method. + + + + If false will not execute. + + + + + Represents declarative filtering. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The member. + The filter operator. + The filter value. + + + + Creates a predicate filter expression. + + The parameter expression, which will be used for filtering. + A predicate filter expression. + + + + Determines whether the specified descriptor + is equal to the current one. + + The other filter descriptor. + + True if all members of the current descriptor are + equal to the ones of , otherwise false. + + + + + Determines whether the specified + is equal to the current descriptor. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current filter descriptor. + + + + + Gets or sets the member name which will be used for filtering. + + The member that will be used for filtering. + + + + Gets or sets the type of the member that is used for filtering. + Set this property if the member type cannot be resolved automatically. + Such cases are: items with ICustomTypeDescriptor, XmlNode or DataRow. + Changing this property did not raise + event. + + The type of the member used for filtering. + + + + Gets or sets the filter operator. + + The filter operator. + + + + Gets or sets the target filter value. + + The filter value. + + + + Represents collection of . + + + + + Operator used in + + + + + Left operand must be smaller than the right one. + + + + + Left operand must be smaller than or equal to the right one. + + + + + Left operand must be equal to the right one. + + + + + Left operand must be different from the right one. + + + + + Left operand must be larger than the right one. + + + + + Left operand must be larger than or equal to the right one. + + + + + Left operand must start with the right one. + + + + + Left operand must end with the right one. + + + + + Left operand must contain the right one. + + + + + Left operand must be contained in the right one. + + + + InvalidOperationException. + + + + Gets the key for this group. + + The key for this group. + + + + Gets the items in this groups. + + The items in this group. + + + + Gets a value indicating whether this instance has sub groups. + + + true if this instance has sub groups; otherwise, false. + + + + + Gets the count. + + The count. + + + + Gets the subgroups, if is true, otherwise empty collection. + + The subgroups. + + + + Gets a value indicating whether this instance has any sub groups. + + + true if this instance has sub groups; otherwise, false. + + + + + Gets the number of items in this group. + + The items count. + + + + Gets the subgroups, if is true, otherwise empty collection. + + The subgroups. + + + + Gets the items in this groups. + + The items in this group. + + + + Gets the key for this group. + + The key for this group. + + + + Gets the aggregate results generated for the given aggregate functions. + + The aggregate results for the provided aggregate functions. + functions is null. + + + + Gets or sets the aggregate functions projection for this group. + This projection is used to generate aggregate functions results for this group. + + The aggregate functions projection. + + + + Creates the aggregate expression that is used for constructing expression + tree that will calculate the aggregate result. + + The grouping expression. + + + + + Generates default name for this function using this type's name. + + + Function name generated with the following pattern: + {.}_{} + + + + + Gets or sets the informative message to display as an illustration of the aggregate function. + + The caption to display as an illustration of the aggregate function. + + + + Gets or sets the name of the aggregate function, which appears as a property of the group record on which records the function works. + + The name of the function as visible from the group record. + + + + Gets or sets a string that is used to format the result value. + + The format string. + + + + Represents a collection of items. + + + + + Gets the with the specified function name. + + + First with the specified function name + if any, otherwise null. + + + + + Initializes a new instance of the class. + + The value of the result. + The number of arguments used for the calculation of the result. + Function that generated the result. + function is null. + + + + Initializes a new instance of the class. + + that generated the result. + function is null. + + + + Initializes a new instance of the class. + + The value of the result. + that generated the result. + + + + Returns a that represents the current . + + + A that represents the current . + + + + + Called when a property has changed. + + Name of the property. + + + + Occurs when a property value changes. + + + + + Gets or sets the value of the result. + + The value of the result. + + + + Gets the formatted value of the result. + + The formatted value of the result. + + + + Gets or sets the number of arguments used for the calulation of the result. + + The number of arguments used for the calulation of the result. + + + + Gets or sets the text which serves as a caption for the result in a user interface.. + + The text which serves as a caption for the result in a user interface. + + + + Gets the name of the function. + + The name of the function. + + + + Gets the first which + is equal to . + + + The for the specified function if any, otherwise null. + + + + + Represents a function that returns the arithmetic mean of a set of arguments. + + + + + Represents an that uses aggregate extension + methods provided in using + as a member selector. + + + + + Base class for all aggregate functions that will use extension + methods in for aggregation. + + + + + Generates default name for this function using . + + + Function name generated with the following pattern: + {}_{} + + + + + Gets the name of the aggregate method on the + that will be used for aggregation. + + The name of the aggregate method that will be used. + + + + Gets the type of the extension methods that holds the extension methods for + aggregation. For example or . + + + The type of that holds the extension methods. The default value is . + + + + + Creates the aggregate expression using . + + The grouping expression. + + + + + Generates default name for this function using + and . + + + Function name generated with the following pattern: + {}{}_{} + + + + + Gets or sets the name of the field, of the item from the set of items, which value is used as the argument of the aggregate function. + + The name of the field to get the argument value from. + + + + Initializes a new instance of the class. + + + + + Gets the the Average method name. + + Average. + + + + Represents a function that returns the number of items in a set of items, including nested sets. + + + + + Represents an that uses aggregate extension + methods provided in . + + + + + Creates the aggregate expression using . + + The grouping expression. + + + + + Initializes a new instance of the class. + + + + + Gets the the Count method name. + + Count. + + + + Represents a function that returns the first item from a set of items. + + + + + Initializes a new instance of the class. + + + + + Gets the the First method name. + + First. + + + + Represents a function that returns the last item from a set of items. + + + + + Initializes a new instance of the class. + + + + + Gets the the Last method name. + + Last. + + + + Represents a function that returns the greatest item from a set of items. + + + + + Initializes a new instance of the class. + + + + + Gets the the Max method name. + + Max. + + + + Represents a function that returns the least item from a set of items. + + + + + Initializes a new instance of the class. + + + + + Gets the the Min method name. + + Min. + + + + Represents a function that returns the sum of all items from a set of items. + + + + + Initializes a new instance of the class. + + + + + Gets the the Min method name. + + Min. + + + + Represents grouping criteria. + + + + + Changes the to the next logical value. + + + + + Gets or sets the member name which will be used for sorting. + + The member that will be used for sorting. + + + + Gets or sets the type of the member that is used for grouping. + Set this property if the member type cannot be resolved automatically. + Such cases are: items with ICustomTypeDescriptor, XmlNode or DataRow. + Changing this property did not raise + event. + + The type of the member used for grouping. + + + + Gets or sets the content which will be used from UI. + + The content that will be used from UI. + + + + Gets or sets the sort direction for this sort descriptor. If the value is null + no sorting will be applied. + + The sort direction. The default value is null. + + + + Gets or sets the aggregate functions used when grouping is executed. + + The aggregate functions that will be used in grouping. + + + + Calculates unique int for given group in a group sequence, + taking into account groups order, each group key and groups' count. + + + + + Defines the fluent interface for configuring the component. + + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The component. + + + + Sets the initial value of the textbox. + + + + + Sets the step, used ti increment/decrement the value of the textbox. + + + + + Sets the minimal possible value allowed to the user. + + + + + Sets the maximal possible value allowed to the user. + + + + + Sets the group size of the number. + + + + + Sets the group separator of the number. + + + + + Sets the index of the negative pattern. + + + + + Sets the text which will be displayed if the textbox is empty. + + + + + Enables or disables the spin buttons. + + + + + + + Define the tooltip text of the up button. + + + + + Define the tooltip text of the down button. + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().NumericTextBox() + .Name("NumericTextBox") + .ClientEvents(events => + events.OnLoad("onLoad").OnChange("onChange") + ) + %> + + + + + + Sets the Input HTML attributes. + + The HTML attributes. + + + + + Defines the fluent interface for configuring the component. + + + + + + Defines the number of the decimal digits. + + + + + Sets the decimal separator. + + + + + Sets the index of the positive pattern. + + + + + Sets the percent symbol. + + + + + Defines the fluent interface for configuring the component. + + + + + + Defines the number of the decimal digits. + + + + + Sets the decimal separator. + + + + + Sets the index of the positive pattern. + + + + + Sets the currency symbol. + + + + + Represents declarative sorting. + + + + + Gets or sets the member name which will be used for sorting. + + The member that will be used for sorting. + + + + Gets or sets the sort direction for this sort descriptor. If the value is null + no sorting will be applied. + + The sort direction. The default value is null. + + + source is null. + + + + Resolves this instance. + + The type of the service. + + + + + Registers the specified service as singleton. + + The type of the service. + The service. + + + + + Registers the specified factory. + + The type of the service. + The factory. + + + + ReSharper disable UnusedParameter.Local + + + + Executes the provided delegate for each item. + + + The instance. + The action to be applied. + + + index is out of range. + + + first is null. + second is null. + resultSelector is null. + + + + Initializes a new instance of the class. + + The source. + + + + Sorts the elements of a sequence using the specified sort descriptors. + + A sequence of values to sort. + The sort descriptors used for sorting. + + An whose elements are sorted according to a . + + + + + Pages through the elements of a sequence until the specified + using . + + A sequence of values to page. + Index of the page. + Size of the page. + + An whose elements are at the specified . + + + + + Projects each element of a sequence into a new form. + + + An whose elements are the result of invoking a + projection selector on each element of . + + A sequence of values to project. + A projection function to apply to each element. + + + + Groups the elements of a sequence according to a specified key selector function. + + An whose elements to group. + A function to extract the key for each element. + + An with items, + whose elements contains a sequence of objects and a key. + + + + + Sorts the elements of a sequence in ascending order according to a key. + + + An whose elements are sorted according to a key. + + + A sequence of values to order. + + + A function to extract a key from an element. + + + + + Sorts the elements of a sequence in descending order according to a key. + + + An whose elements are sorted in descending order according to a key. + + + A sequence of values to order. + + + A function to extract a key from an element. + + + + + Calls + or depending on the . + + The source. + The key selector. + The sort direction. + + An whose elements are sorted according to a key. + + + + + Groups the elements of a sequence according to a specified . + + An whose elements to group. + The group descriptors used for grouping. + + An with items, + whose elements contains a sequence of objects and a key. + + + + + Calculates the results of given aggregates functions on a sequence of elements. + + An whose elements will + be used for aggregate calculation. + The aggregate functions. + Collection of s calculated for each function. + + + + Filters a sequence of values based on a predicate. + + + An that contains elements from the input sequence + that satisfy the condition specified by . + + An to filter. + A function to test each element for a condition. + + + + Filters a sequence of values based on a collection of . + + The source. + The filter descriptors. + + An that contains elements from the input sequence + that satisfy the conditions specified by each filter descriptor in . + + + + + Returns a specified number of contiguous elements from the start of a sequence. + + + An that contains the specified number + of elements from the start of . + + The sequence to return elements from. + The number of elements to return. + is null. + + + + Bypasses a specified number of elements in a sequence + and then returns the remaining elements. + + + An that contains elements that occur + after the specified index in the input sequence. + + + An to return elements from. + + + The number of elements to skip before returning the remaining elements. + + is null. + + + Returns the number of elements in a sequence. + The number of elements in the input sequence. + + The that contains the elements to be counted. + + is null. + + + Returns the element at a specified index in a sequence. + The element at the specified position in . + An to return an element from. + The zero-based index of the element to retrieve. + is null. + is less than zero. + + + + Creates a from an where T is . + + + A that contains elements from the input sequence. + + + The to create a from. + + + is null. + + + + + Default Service locator. + + + + + Initializes a new instance of the class. + + if set to true [debug mode]. + + + + Resolves this instance. + + The type of the service. + + + + + Registers the specified service as singleton. + + The type of the service. + The service. + + + + + Registers the specified factory. + + The type of the service. + The factory. + + + + + Disposes the resources. + + + + + Represents an attribute that is used to populate in view data. + + + + + Initializes a new instance of the class. + + The site maps. + + + + Initializes a new instance of the class. + + + + + Called before an action result executes. + + The filter context. + + + + Called after an action result executes. + + The filter context. + + + + Gets or sets the default view data key. + + The default view data key. + + + + Gets or sets the name of the site map. + + The name of the site map. + + + + Gets or sets the view data key. + + The view data key. + + + + Gets or sets the site maps. + + The site maps. + + + + Defines a base class that represents site map. + + + + + Initializes a new instance of the class. + + + + + Performs an implicit conversion from to . + + The site map. + The result of the conversion. + + + + Returns a new builder. + + + + + + Resets this instance. + + + + + Gets or sets the default cache duration in minutes. + + The default cache duration in minutes. + + + + Gets or sets a value indicating whether [default compress]. + + true if [default compress]; otherwise, false. + + + + Gets or sets a value indicating whether [default generate search engine map]. + + + true if [default generate search engine map]; otherwise, false. + + + + + Gets or sets the root node. + + The root node. + + + + Gets or sets the cache duration in minutes. + + The cache duration in minutes. + + + + Gets or sets a value indicating whether this is compress. + + true if compress; otherwise, false. + + + + Gets or sets a value indicating whether [generate search engine map]. + + + true if [generate search engine map]; otherwise, false. + + + + + The builder to fluently configuring . + + + + + Initializes a new instance of the class. + + The site map. + + + + Performs an implicit conversion from to . + + The builder. + The result of the conversion. + + + + Returns the internal sitemap. + + + + + + Caches the duration in minutes. + + The value. + + + + + Compresses the specified value. + + if set to true [value]. + + + + + Generates the search engine map. + + if set to true [value]. + + + + + Gets the root node. + + The root node. + + + + Sitemap change frequency + + + + + Automatic + + + + + Daily + + + + + Always + + + + + Hourly + + + + + Weekly + + + + + Monthly + + + + + Yearly + + + + + Never + + + + + Defines a class that is used to store against a key. + + + + + Registers the specified name. + + The type of the site map. + The name. + The configure. + + + + + Adds an item to the . + + The object to add to the . + + The is read-only. + + + + + Adds an element with the provided key and value to the . + + The object to use as the key of the element to add. + The object to use as the value of the element to add. + + is null. + + + An element with the same key already exists in the . + + + The is read-only. + + + + + Removes all items from the . + + + The is read-only. + + + + + Determines whether the contains a specific value. + + The object to locate in the . + + true if is found in the ; otherwise, false. + + + + + Determines whether the contains an element with the specified key. + + The key to locate in the . + + true if the contains an element with the key; otherwise, false. + + + is null. + + + + + Copies the elements of the to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + is null. + + + is less than 0. + + + is multidimensional. + -or- + is equal to or greater than the length of . + -or- + The number of elements in the source is greater than the available space from to the end of the destination . + -or- + Type cannot be cast automatically to the type of the destination + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Removes the first occurrence of a specific object from the . + + The object to remove from the . + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + + The is read-only. + + + + + Removes the element with the specified key from the . + + The key of the element to remove. + + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original . + + + is null. + + + The is read-only. + + + + + Gets the value associated with the specified key. + + The key whose value to get. + When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the parameter. This parameter is passed uninitialized. + + true if the object that implements contains an element with the specified key; otherwise, false. + + + is null. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Gets or sets the default site map factory. + + The default site map factory. + + + + Gets or sets the default site map. + + The default site map. + + + + Gets the number of elements contained in the . + + + + The number of elements contained in the . + + + + + Gets a value indicating whether the is read-only. + + + true if the is read-only; otherwise, false. + + + + + Gets an containing the keys of the . + + + + An containing the keys of the object that implements . + + + + + Gets an containing the values in the . + + + + An containing the values in the object that implements . + + + + + Gets or sets the with the specified key. + + + + + + Defines a class that is used to generate searach engine sitemap xml. + + + + + Provides a common base set of functionality for IHttpHandler implementations. + + + + + Enables processing of HTTP Web requests by a custom HttpHandler that implements the interface. + + An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests. + + + + Processes the request. + + The context. + + + + Gets a value indicating whether another request can use the instance. + + + true if the instance is reusable; otherwise, false. + + + + Initializes a new instance of the class. + + The site maps. + The HTTP response compressor. + The HTTP response cacher. + The URL generator. + + + + Initializes a new instance of the class. + + + + + Processes the request. + + The context. + + + + Gets or sets the default path. + + The default path. + + + + Defines a class that is used to store global sitemaps. + + + + + Gets the site maps. + + The site maps. + + + + Defines a class that is used to store single url. + + + + + Serves as the base class for classes that provides linked object information. + + + + + Gets or sets the T object that is the parent of the current node. + + The parent. + + + + Gets the previous T object on the same level as the current one, relative to the T.ParentNode object (if one exists). + + The previous sibling. + + + + Gets the next T node on the same hierarchical level as the current one, relative to the T.ParentNode property (if one exists). + + The next sibling. + + + + Initializes a new instance of the class. + + + + + Performs an implicit conversion from to . + + The node. + The result of the conversion. + + + + Gets or sets the title. + + The title. + + + + Gets or sets a value indicating whether this is visible. + + true if visible; otherwise, false. + + + + Gets or sets the last modified at. + + The last modified at. + + + + Gets or sets the name of the route. + + The name of the route. + + + + Gets or sets the name of the controller. + + The name of the controller. + + + + Gets or sets the name of the action. + + The name of the action. + + + + Gets or sets the route values. + + The route values. + + + + Gets or sets the URL. + + The URL. + + + + Gets or sets the change frequency. + + The change frequency. + + + + Gets or sets the update priority. + + The update priority. + + + + Gets or sets a value indicating whether [include in search engine index]. + + + true if [include in search engine index]; otherwise, false. + + + + + Gets or sets the attributes. + + The attributes. + + + + Gets or sets the child nodes. + + The child nodes. + + + + Builder class for fluently configuring . + + + + + Initializes a new instance of the class. + + The site map node. + + + + Performs an implicit conversion from to . + + The builder. + The result of the conversion. + + + + Returns the internal node. + + + + + + Sets the title. + + The value. + + + + + Sets the visibility. + + if set to true [value]. + + + + + Sets the Lasts the modified date.. + + The value. + + + + + Sets the route. + + Name of the route. + The route values. + + + + + Sets the route. + + Name of the route. + The route values. + + + + + Sets the route. + + Name of the route. + + + + + Sets the action, controller and route values. + + Name of the action. + Name of the controller. + The route values. + + + + + Sets the action, controller and route values. + + Name of the action. + Name of the controller. + The route values. + + + + + Sets the action and controller. + + Name of the action. + Name of the controller. + + + + + Expression based controllerAction. + + The type of the controller. + The action. + + + + + Sets the url. + + The value. + + + + + Sets the change frequency. + + The value. + + + + + Sets the update priority. + + The value. + + + + + Marks an item that it would be included in the search engine index. + + if set to true [value]. + + + + + Sets the attributes + + The value. + + + + + Sets the attributes + + The value. + + + + + Executes the provided delegate to configure the child node. + + The add actions. + + + + + Defines a factory that is used to create . + + + + + Initializes a new instance of the class. + + The parent. + + + + Adds this instance. + + + + + + Sitemap update priority. + + + + + Automatic + + + + + Low + + + + + Normal + + + + + High + + + + + Critical + + + + + Xml file based sitemap. + + + + + Initializes a new instance of the class. + + The path resolver. + The file system. + The cache manager. + + + + Initializes a new instance of the class. + + + + + Loads from the default path. + + + + + Loads from the specified path. + + The relative virtual path. + + + + Gets or sets the default path. + + The default path. + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The component. + + + + Sets selected date. + + DateTime object represents the selected date. + + + + Sets selected date. + + Date passed as string. + + + + Sets the smallest possible date, which user can choose. + + + + + Sets the smallest possible date, which user can choose. + + + + + Sets the biggest possible date, which user can choose. + + + + + Sets the smallest possible date, which user can choose. + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().Calendar() + .Name("Calendar") + .ClientEvents(events => + events.OnLoad("onLoad") + ) + %> + + + + + + Configures the selection settings of the calendar. + + SelectAction settings, which includes Action name and IEnumerable of DateTime objects. + + + + + Defines fluent interface for configuring calendar client events. + + + + + Initializes a new instance of the class. + + Client events of the calendar. + The context of the View. + + + + Defines the inline handler of the OnSelect client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Calendar() + .Name("Calendar") + .ClientEvents(events => events.OnChange(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the OnDateSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Calendar() + .Name("Calendar") + .ClientEvents(events => events.OnChange("onChange")) + %> + + + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Calendar() + .Name("Calendar") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Contains constants for CSS class names, used across all UI extensions + + + + + Next navigation link + + + + + Previous navigavtion link + + + + + Previous navigavtion link + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The selection settings. + The view context. + + + + Defines list of dates. This list determines which dates to be rendered with action link. + + List of objects + + + + Sets the action to which the date should navigate + + Name of the action. + The route values. + + + + Sets the action to which the item should navigate + + Name of the action. + Name of the controller. + The route values. + + + + Defines the fluent interface for configuring delete action command. + + + + + + Defines the fluent interface for configuring command. + + The type of the model + The type of the command. + The type of the builder. + + + + Initializes a new instance of the class. + + The column. + + + + Sets the button type. + + The button type. + + + + + Sets the HTML attributes. + + The HTML attributes. + + + + + Sets the image HTML attributes. + + The Image HTML attributes. + + + + + Initializes a new instance of the class. + + The command. + + + + Represents a column in the component + + The type of the data item + + + + Gets or sets the grid. + + The grid. + + + + Gets the member of the column. + + The member. + + + + Gets the template of the column. + + + + + Gets or sets the title of the column. + + The title. + + + + Gets or sets the width of the column. + + The width. + + + + Gets or sets a value indicating whether this column is hidden. + + true if hidden; otherwise, false. + + Hidden columns are output as HTML but are not visible by the end-user. + + + + + Gets the header HTML attributes. + + The header HTML attributes. + + + + Gets or sets a value indicating whether this column is visible. + + true if visible; otherwise, false. The default value is true. + + Invisible columns are not output in the HTML. + + + + + Gets the HTML attributes of the cell rendered for the column + + The HTML attributes. + + + + Defines the fluent interface for configuring the edit action command. + + + + + + Initializes a new instance of the class. + + The command. + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables binding. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home").Enabled((bool)ViewData["ajax"]); + }) + %> + + + + The Enabled method is useful when you need to enable binding based on certain conditions. + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home", new { {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home"); + }) + %> + + + + + + Sets the route and values for the select operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the route and values for the select operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default", new {id=1}); + }) + %> + + + + + + Sets the route name for the select operation + + Name of the route. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default"); + }) + %> + + + + + + Sets the action, controller and route values for the select operation + + The type of the controller. + The action. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select<HomeController>(controller => controller.Index())); + }) + %> + + + + + + Sets the action, controller and route values for insert operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for insert operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Insert("Index", "Home", new { {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for insert operation + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Insert("Index", "Home"); + }) + %> + + + + + + Sets the route and values for insert operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the route and values for insert operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Insert("Default", new {id=1}); + }) + %> + + + + + + Sets the route name for insert operation + + Name of the route. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Insert("Default"); + }) + %> + + + + + + Sets the action, controller and route values for insert operation + + The type of the controller. + The action. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Insert<HomeController>(controller => controller.Index())); + }) + %> + + + + + + Sets the action, controller and route values for delete operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Insert("Index", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for update operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Update("Index", "Home", new { {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for update operation + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Update("Index", "Home"); + }) + %> + + + + + + Sets the route and values for update operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Update("Default", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the route and values for update operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Update("Default", new {id=1}); + }) + %> + + + + + + Sets the route name for update operation + + Name of the route. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Update("Default"); + }) + %> + + + + + + Sets the action, controller and route values for update operation + + The type of the controller. + The action. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Update<HomeController>(controller => controller.Index())); + }) + %> + + + + + + Sets the action, controller and route values for delete operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Delete("Index", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for delete operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Delete("Index", "Home", new { {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for delete operation + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Delete("Index", "Home"); + }) + %> + + + + + + Sets the route and values for delete operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Delete("Default", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the route and values for delete operation + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Delete("Default", new {id=1}); + }) + %> + + + + + + Sets the route name for delete operation + + Name of the route. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Delete("Default"); + }) + %> + + + + + + Sets the action, controller and route values for delete operation + + The type of the controller. + The action. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Delete<HomeController>(controller => controller.Index())); + }) + %> + + + + + + Defines the fluent interface for configuring the data binding. + + + + + Initializes a new instance of the class. + + The configuration. + + + + Use it to configure Server binding. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Server().Select("FirstLook", "Grid"}); + }) + .Pagealbe() + .Sortable(); + %> + + + + + + Use it to configure Ajax binding. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("_FirstLook", "Grid").Enabled((bool)ViewData["ajax"]); + }) + .Pagealbe() + .Sortable(); + %> + + + + + + Use it to configure web service binding. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.WebService().Select("~/Models/Orders.asmx/GetOrders") + }) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + %> + + + + + + Defines the fluent interface for configuring the data key. + + The type of the model + The type of the value. + + + + Initializes a new instance of the class. + + The dataKey. + + + + Sets the RouteKey. + + The value. + + + + + Creates data key for the . + + The type of the data item + + + + Initializes a new instance of the class. + + The grid. + + + + Defines a data key. + + + + + + + + Defines which objects can have child items. + + + + + + Child items collection. + + + + + Defines the fluent interface for configuring the component. + + + + + + Defines the number of the decimal digits. + + + + + Sets the decimal separator. + + + + + Defines the fluent interface for configuring the . + + + + + Defines the inline handler of the OnChange client-side event + + The action defining the inline handler. + + + <% Html.Telerik().IntegerTextBox() + .Name("IntegerTextBox") + .ClientEvents(events => events.OnChange(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnChange client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().IntegerTextBox() + .Name("IntegerTextBox") + .ClientEvents(events => events.OnChange("onChange")) + %> + + + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().IntegerTextBox() + .Name("IntegerTextBox") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().IntegerTextBox() + .Name("IntegerTextBox") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the fluent interface for configuring TreeView drag&drop. + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables / disables drag&drop functionality. + + Whether to enable or to disable the drag&drop. + + + + Allows elements to be dropped on arbitrary HTML elements + + jQuery selector that specifies the elements that qualify as drop targets. + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables binding. + + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home").Enabled((bool)ViewData["ajax"]); + }) + %> + + + + The Enabled method is useful when you need to enable binding based on certain conditions. + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home", new { {"id", 1} }); + }) + %> + + + + + + Sets the action, controller and route values for the select operation + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Index", "Home"); + }) + %> + + + + + + Sets the route and values for the select operation + + Name of the route. + The route values. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default", "Home", new RouteValueDictionary{ {"id", 1} }); + }) + %> + + + + + + Sets the route and values for the select operation + + Name of the route. + The route values. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default", new {id=1}); + }) + %> + + + + + + Sets the route name for the select operation + + Name of the route. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => + { + dataBinding.Ajax().Select("Default"); + }) + %> + + + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The component. + + + + Defines the items in the TreeView + + The add action. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => + .OnDataBinding("onDataBinding") + .OnItemDataBound("onItemDataBound") + ) + %> + + + + + + Sets the theme of the TreeView + + + + + Binds the TreeView to a sitemap + + The view data key. + The action to configure the item. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .BindTo("examples", (item, siteMapNode) => + { + }) + %> + + + + + + Binds the TreeView to a sitemap. + + The view data key. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .BindTo("examples") + %> + + + + + + Binds the TreeView to a list of objects. The TreeView will be "flat" which means a TreeView item will be created for + every item in the data source. + + The type of the data item + The data source. + The action executed for every data bound item. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .BindTo(new []{"First", "Second"}, (item, value) + { + item.Text = value; + }) + %> + + + + + + Binds the TreeView to a list of objects. The TreeView will create a hierarchy of items using the specified mappings. + + The type of the data item + The data source. + The action which will configure the mappings + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .BindTo(Model, mapping => mapping + .For<Customer>(binding => binding + .Children(c => c.Orders) // The "child" items will be bound to the the "Orders" property + .ItemDataBound((item, c) => item.Text = c.ContactName) // Map "Customer" properties to TreeViewItem properties + ) + .For<Order<(binding => binding + .Children(o => null) // "Orders" do not have child objects so return "null" + .ItemDataBound((item, o) => item.Text = o.OrderID.ToString()) // Map "Order" properties to TreeViewItem properties + ) + ) + %> + + + + + + Use it to configure Data binding. + + Action that configures the data binding options. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => dataBinding + .Ajax().Select("_AjaxLoading", "TreeView") + ); + %> + + + + + + Callback for each item. + + Action, which will be executed for each item. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ItemAction(item => + { + item + .Text(...) + .HtmlAttributes(...); + }) + %> + + + + + + Select item depending on the current URL. + + If true the item will be highlighted. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .HighlightPath(true) + %> + + + + + + Configures the effects of the TreeView. + + The action which configures the effects. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Effects(fx => + { + fx.Slide() + .Opacity() + .OpenDuration(AnimationDuration.Normal) + .CloseDuration(AnimationDuration.Normal); + }) + + + + + + Expand all the items. + + If true all the items will be expanded. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ExpandAll(true) + %> + + + + + + ShowLines indicates if lines connecting child nodes to parent nodes are displayed. + + If true lines connecting child nodes to parent nodes are displayed. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ShowLines(true) + %> + + + + + + ShowCheckBox indicates if checkbox displayed before node. + + If true checkbox will be displayed for every node. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ShowCheckBox(true) + %> + + + + + + Enables drag & drop between treeview nodes. + + If true, drag & drop is enabled. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + .DragAndDrop(true) + %> + + + + + + Enables drag & drop between treeview nodes. + + Action that configures the drag and drop options. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + .DragAndDrop(settings => + { + + }) + %> + + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The client events. + The view context. + + + + Defines the inline handler of the OnExpand client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnExpand(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnExpand client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnExpand("onExpand")) + %> + + + + + + Defines the inline handler of the OnCollapse client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnCollapse(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnCollapse client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnCollapse("onCollapse")) + %> + + + + + + Defines the inline handler of the OnSelect client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnSelect(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnSelect("onSelect")) + %> + + + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the inline handler of the OnError client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnError(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnError client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnError("onError")) + %> + + + + + + Defines the inline handler of the OnNodeDragStart client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDragStart(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnNodeDragStart client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDragStart("onNodeDragStrat")) + %> + + + + + + Defines the inline handler of the OnNodeDrop client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDrop(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnNodeDrop client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDrop("OnNodeDrop")) + %> + + + + + + Defines the inline handler of the OnNodeDropped client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDropped(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnNodeDropped client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDropped("OnNodeDropped")) + %> + + + + + + Defines the inline handler of the OnNodeDragCancelled client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDragCancelled(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnNodeDragCancelled client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDragCancelled("OnNodeDragCancelled")) + %> + + + + + + Defines the inline handler of the OnNodeDragging client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDragging(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnNodeDragging client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnNodeDragging("OnNodeDragging")) + %> + + + + + + Defines the inline handler of the OnDataBinding client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnDataBinding(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDataBinding client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnDataBinding("OnDataBinding")) + %> + + + + + + Defines the inline handler of the OnDataBound client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnDataBound(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDataBound client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnDataBound("OnDataBound")) + %> + + + + + + Defines the inline handler of the OnChecked client-side event. Requires ShowCheckBox to be true. + + The action defining the inline handler. + + + <% Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnChecked(() => + { + %> + function(e) { + // event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnChecked client-side event. Requires ShowCheckBox to be true. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .ClientEvents(events => events.OnChecked("onChecked")) + %> + + + + + + Defines the fluent interface for configuring the data binding. + + + + + Initializes a new instance of the class. + + The configuration. + + + + Use it to configure Ajax binding. + + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => dataBinding + .Ajax().Select("_AjaxLoading", "TreeView") + ) + %> + + + + + + Use it to configure web service binding. + + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => dataBinding + .WebService().Select("~/Models/Employees.asmx/GetEmployees") + ) + %> + + + + + + Defines the fluent interface for configuring child TreeView items. + + + + + Defines the fluent interface for configuring navigation items + + The type of the item. + The type of the builder. + + + + Initializes a new instance of the class. + + The item. + + + + Returns the inner navigation item + + + + + + Sets the HTML attributes applied to the outer HTML element rendered for the item + + The attributes. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Attributes(new {@class="first-item"})) + %> + + + + + + Sets the text displayed by the item. + + The value. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item")) + %> + + + + + + Makes the item visible or not. Invisible items are not rendered in the output HTML. + + + Sets the text displayed by the item. + + The value. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item").Visible((bool)ViewData["visible"]) + %> + + + + + + Enables or disables the item. Disabled item cannot be clicked, expanded or open (depending on the item type - menu, tabstrip, panelbar). + + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item").Enabled((bool)ViewData["enabled"]) + %> + + + + + + Selects or unselects the item. By default items are not selected. + + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item").Selected(true)) + %> + + + + + + Sets the route to which the item should navigate. + + Name of the route. + The route values. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item").Route("Default", new RouteValueDictionary{{"id", 1}})) + %> + + + + + + Sets the route to which the item should navigate. + + Name of the route. + The route values. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item").Route("Default", new {id, 1})) + %> + + + + + + Sets the route to which the item should navigate. + + Name of the route. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item").Route("Default")) + %> + + + + + + Sets the action to which the item should navigate + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("Index").Action("Index", "Home", new RouteValueDictionary{{"id", 1}})) + %> + + + + + + Sets the action to which the item should navigate + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("Index").Action("Index", "Home", new {id, 1})) + %> + + + + + + Sets the action to which the item should navigate + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("Index").Action("Index", "Home")) + %> + + + + + + Sets the URL to which the item should navigate + + The value. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("www.example.com").Url("http://www.example.com")) + %> + + + + + + Sets the URL of the image that should be displayed by the item. + + The value. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("First Item").ImageUrl("~/Content/first.png")) + %> + + + + + + Sets the HTML attributes for the item image. + + The attributes. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items + .Add().Text("First Item") + .ImageUrl("~/Content/first.png") + .ImageHtmlAttributes(new {@class="first-item-image"})) + %> + + + + + + Sets the sprite CSS class names. + + The CSS classes. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items + .Add().Text("First Item") + .SpriteCssClasses("icon", "first-item") + %> + + + + + + Sets the HTML content which the item should display. + + The action which renders the content. + + <% Html.Telerik().Menu() + .Name("Menu") + .Items(items => items + .Add() + .Text("First Item") + .Content(() => + { + %> + <strong> First Item Content</strong> + <% + });) + .Render(); + %> + + + + + Sets the HTML content which the item should display as a string. + + The action which renders the content. + + <% Html.Telerik().Menu() + .Name("Menu") + .Items(items => items + .Add() + .Text("First Item") + .Content("<strong> First Item Content</strong>"); + ) + .Render(); + %> + + + + + Sets the HTML attributes of the content element of the item. + + The attributes. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items + .Add().Text("First Item") + .Content(() => { %> <strong>First Item Content</strong> <% }) + .ContentHtmlAttributes(new {@class="first-item-content"}) + %> + + + + + + Makes the item navigate to the specified controllerAction method. + + The type of the controller. + The action. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items + .Add().Text("First Item") + .Action<HomeController>(controller => controller.Index())) + + %> + + + + + + Sets whether the Text property should be encoded when the item is rendered. + + Whether the property should be encoded. Default: true. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => items.Add().Text("<strong>First Item</strong>").Encoded(false)) + %> + + + + + + Initializes a new instance of the class. + + The item. + + + + Configures the child items of a . + + The add action. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }); + }) + %> + + + + + + Sets the value for the item. + + The value. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => items.Add().Value("1")) + %> + + + + + + Define when the item will be expanded on intial render. + + If true the item will be expanded. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }) + .Expanded(true); + }) + %> + + + + + + Define when the item will be checked on intial render. + + If true the item will be checked. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }) + .Checked(true); + }) + %> + + + + + + Enables/disables the rendering of a checkbox for this item. + + If false, no checkbox will be rendered. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }) + .Checkable(false); + }) + %> + + + + + + Sets the expand mode of the treeview item. + + If true then item will be load on demand from client side. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }) + .LoadOnDemand(true); + }) + %> + + + + + + Creates items for the . + + + + + Initializes a new instance of the class. + + The settings. + + + + Defines a item. + + + + + + Defines the fluent interface for configuring the treeview webservice. + + + + + Initializes a new instance of the class. + + The settings. + + + + Specify the web service url for loading data + + The web service url + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => dataBinding + .WebService().Select("~/Models/Employees.asmx/GetEmployees") + ) + %> + + + + + + Enables / disables web service functionality. + + Whether to enable or to disable the web service. + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .DataBinding(dataBinding => dataBinding + .Ajax().Enabled(true).Select("_AjaxLoading", "TreeView") + ) + %> + + + + The Enabled method is useful when you need to enable ajax based on certain conditions. + + + + + Telerik Treeview for ASP.NET MVC is a view component for presenting hierarchical data. + + + + + Initializes a new instance of the class. + + The view context. + The client side object writer factory. + The URL generator. + The navigation item authorization. + The builder factory. + + + + Gets the client events of the treeview. + + The client events. + + + + Gets or sets the theme. + + + + + Gets the items of the treeview. + + + + + Gets or sets the item action. + + + + + Gets or sets the effects. + + + + + Gets or sets a value indicating whether all the item is expanded. + + true if expand all is enabled; otherwise, false. The default value is false + + + + Gets or sets a value indicating whether all the item is expanded. + + true if expand all is enabled; otherwise, false. The default value is false + + + + Gets or sets a value indicating whether all the item is expanded. + + true if expand all is enabled; otherwise, false. The default value is false + + + + Gets the ajax configuration. + + + + + Gets the web service configuration + + + + + + Defines whether one navigation item can have content output immediately + + + + + The HtmlAttributes which will be added to the wrapper of the content. + + + + + The action which will output the content. + + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The component. + + + + Sets the theme of the datepicker + + + + + Configures the effects of the datepicker. + + The action which configures the effects. + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + .Effects(fx => + { + fx.Height() + .Opacity() + .OpenDuration(AnimationDuration.Normal) + .CloseDuration(AnimationDuration.Normal); + }) + + + + + + Sets whether datepicker to be rendered with button, which shows calendar on click + + + + + Sets the title of the datepicker button. + + + + + Sets the date format, which will be used to parse and format the machine date. + + + + + Sets the value of the datepicker input + + + + + Sets the value of the datepicker input + + + + + Sets the minimal date, which can be selected in DatePicker. + + + + + Sets the minimal date, which can be selected in DatePicker. + + + + + Sets the maximal date, which can be selected in DatePicker. + + + + + Sets the maximal date, which can be selected in DatePicker. + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => + events.OnLoad("onLoad").OnSelect("onSelect") + ) + %> + + + + + + Sets the Input HTML attributes. + + The HTML attributes. + + + + Defines the fluent interface for configuring datepicker client events. + + + + + Initializes a new instance of the class. + + Datepicker client-side events. + The context of the View. + + + + Defines the inline handler of the OnSelect client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnChange(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnChange("onChange")) + %> + + + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the inline handler of the OnPopupOpen client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnOpen(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnPopupOpen client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnOpen("onOpen")) + %> + + + + + + Defines the inline handler of the OnPopupClose client-side event + + The action defining the inline handler. + + + <% Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnClose(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnPopupClose client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + .ClientEvents(events => events.OnClose("onClose")) + %> + + + + + + Sets the Url, which will be requested to return the content. + + The action name. + The controller name. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(parent => { + + parent.Add() + .Text("Completely Open Source") + .LoadContentFrom("AjaxView_OpenSource", "PanelBar"); + }) + %> + + + + + + Sets the Url, which will be requested to return the content. + + The action name. + The controller name. + Route values. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(parent => { + + parent.Add() + .Text("Completely Open Source") + .LoadContentFrom("AjaxView_OpenSource", "PanelBar", new { id = 10}); + }) + %> + + + + + + Sets the Url, which will be requested to return the content. + + The url. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(parent => { + + parent.Add() + .Text("Completely Open Source") + .LoadContentFrom(Url.Action("AjaxView_OpenSource", "PanelBar")); + }) + %> + + + + + + Defines the fluent interface for configuring the ajax settings + + + + + Defines the fluent interface for building + + + + + Initializes a new instance of the class. + + The settings. + + + + Sets the route and values + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Ajax(ajax => ajax.Route("Default", new {id=1})) + %> + + + + + + Sets the route and values + + Name of the route. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Ajax(ajax => ajax.Route("Default", new RouteValueDictionary{{"id",1}})) + %> + + + + + + Sets the route name + + Name of the route. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Ajax(ajax => ajax.Route("Default")) + %> + + + + + + Sets the action, controller and route values + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Ajax(ajax => ajax.Action("Index", "Home", new {id = 1})) + %> + + + + + + Sets the action, controller and route values + + Name of the action. + Name of the controller. + The route values. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Ajax(ajax => ajax.Action("Index", "Home", new RouteValueDictionary{ {"id", 1} })) + %> + + + + + + Sets the action, controller and route values + + Name of the action. + Name of the controller. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Ajax(ajax => ajax.Action("Index", "Home")) + %> + + + + + + Gets or sets the settings. + + The settings. + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables Ajax binding. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Ajax(ajax => ajax.Enabled((bool)ViewData["enableAjax"])) + %> + + + + The Enabled method is useful when you need to enable ajax based on certain conditions. + + + + + Initializes a new instance of the class. + + The property to which the column is bound to. + + + + Gets type of the property to which the column is bound to. + + + + + Gets or sets a value indicating whether this column is groupable. + + true if groupable; otherwise, false. + + + + Gets the name of the column + + + + + Gets a function which returns the value of the property to which the column is bound to. + + + + + Gets or sets a value indicating whether this is sortable. + + true if sortable; otherwise, false. The default value is true. + + + + Gets or sets a value indicating whether this is filterable. + + true if filterable; otherwise, false. The default value is true. + + + + Defines the fluent interface for configuring bound columns + + The type of the data item + + + + Initializes a new instance of the class. + + The column. + + + + Gets or sets the format for displaying the data. + + The value. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderDate).Format("{0:dd/MM/yyyy}")) + %> + + + + + + Makes the column read-only or not. By default bound columns are not read-only. + + + If a column is read-only it cannot be modified during editing. + + true if the column should be read-only;otherwise false + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderDate).ReadOnly(true)) + %> + + + + + + Makes the column read-only. + + + If a column is read-only it cannot be modified during editing. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderDate).ReadOnly()) + %> + + + + + + Enables or disables sorting the column. All bound columns are sortable by default. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderDate).Sortable(false)) + %> + + + + + + Enables or disables grouping by that column. All bound columns are groupable by default. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderDate).Groupable(false)) + %> + + + + + + Enables or disables filtering the column. All bound columns are filterable by default. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderDate).Filterable(false)) + %> + + + + + + Enables or disables HTML encoding the data of the column. All bound columns are encoded by default. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Columns(columns => columns.Bound(o => o.OrderDate).Encoded(false)) + %> + + + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The events. + The view context. + + + + Defines the inline handler of the OnLoad client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //Load handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnEdit client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnEdit("onEdit")) + %> + + + + + + Defines the inline handler of the OnEdit client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnEdit(() => + { + %> + function(e) { + //edit handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnSave client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnSave("onSave")) + %> + + + + + + Defines the inline handler of the OnSave client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnSave(() => + { + %> + function(e) { + //edit handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDetailViewExpand client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDetailViewExpand("onDetailViewExpand")) + %> + + + + + + Defines the inline handler of the OnDetailViewExpand client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDetailViewExpand(() => + { + %> + function(e) { + //edit handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDetailViewCollapse client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDetailViewCollapse("onDetailViewCollapse")) + %> + + + + + + Defines the inline handler of the OnDetailViewCollapse client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDetailViewCollapse(() => + { + %> + function(e) { + //edit handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDelete client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnSave("onDelete")) + %> + + + + + + Defines the inline handler of the OnSave client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnSave(() => + { + %> + function(e) { + //edit handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the inline handler of the OnColumnResize client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnColumnResize(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnColumnResize client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnColumnResize("onColumnResize")) + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnRowSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnRowSelect("onRowSelect")) + %> + + + + + + Defines the inline handler of the OnRowSelect client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnRowSelect(() => + { + %> + function(e) { + //Error handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the inline handler of the OnError client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnError(() => + { + %> + function(e) { + //Error handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnError client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnError("onError")) + %> + + + + + + Defines the inline error handler of the OnDataBound client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDataBound(() => + { + %> + function(e) { + //data bound handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDataBound client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDataBound("onDataBound")) + %> + + + + + + Defines the inline error handler of the OnDataBinding client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDataBinding(() => + { + %> + function(e) { + //data binding handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnDataBinding client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnDataBinding("onDataBinding")) + %> + + + + + + Defines the inline error handler of the OnRowDataBound client-side event. + + The action defining the inline handler. + + + <% Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnRowDataBound(() => + { + %> + function(e) { + var row = e.row; + var dataItem = e.dataItem; + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnRowDataBound client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .ClientEvents(events => events.OnRowDataBound("onRowDataBound")) + %> + + + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The column. + + + + Creates command for the . + + The type of the data item + + + + Initializes a new instance of the class. + + The column. + + + + Defines a edit command. + + + + + + Defines a delete command. + + + + + + Defines a select command. + + + + + + Defines the fluent interface for configuring . + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables filtering + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Filterable(filtering => filtering.Enabled((bool)ViewData["enableFiltering"])) + %> + + + + The Enabled method is useful when you need to enable filtering based on certain conditions. + + + + + Defines the fluent interface for configuring + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables scrolling. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Scrolling(scrolling => scrolling.Enabled((bool)ViewData["enableScrolling"])) + %> + + + + The Enabled method is useful when you need to enable scrolling based on certain conditions. + + + + + Sets the height of the scrollable area in pixels. + + The height in pixels. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Scrolling(scrolling => scrolling.Height(400)) + %> + + + + + + Sets the height of the scrollable. + + The height in pixels. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Scrolling(scrolling => scrolling.Height("20em")) + %> + + + + + + Defines the fluent interface for configuring the + + + + + Initializes a new instance of the class. + + The settings. + + + The pager will display only a status message + + + The pager will display first/previous/next/last links + + + The pager will display page numbers as link buttons. + + + The pager will display an input field and the total number of pages. + + + (first) (previous) (page numbers) (next) (last) + + + (first) (previous) (page input field) (next) (last) + + + + Defines the fluent interface for configuring + + + + + Enables or disables selection. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Selectable(selection => selection.Enabled((bool)ViewData["enableSelection"])) + %> + + + + The Enabled method is useful when you need to enable scrolling based on certain conditions. + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The settings. + + + + Enables or disables sorting. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Sorting(sorting => sorting.Enabled((bool)ViewData["enableSorting"])) + %> + + + + The Enabled method is useful when you need to enable sorting based on certain conditions. + + + + + Sets the sort mode of the grid. + + The value. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Sorting(sorting => sorting.SortMode(GridSortMode.MultipleColumns)) + %> + + + + + + Configures the initial sort order. + + The configurator. + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The settings. + + + + Sets the url of the web service which the will request for data. + + The value. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .WebService(webService => webService.Url("~/Models/Orders.asmx/GetOrders"))) + %> + + + + + + Enables or disables web service binding. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .WebService(webService => webService.Enabled((bool)ViewData["enableWebServiceBinding"])) + %> + + + + The Enabled method is useful when you need to enable web service binding based on certain conditions. + + + + + Specifies the animation duration of item. + + + + + Fast animation, duration is set to 200. + + + + + Normal animation, duration is set to 400. + + + + + Slow animation, duration is set to 600. + + + + + Helper class to convert jQuery Animation Duration. + + + + + Converts specified duration in jQuery equivalent value. + + The duration. + + + + + Defines whether one navigation item can have content loaded asynchroniously. + + + + + Url, which will be used as a destination for the Ajax request. + + + + + Defines the basic building block of creating client side object. + + + + + Starts writing this instance. + + + + + + Appends the specified key value pair to the end of this instance. + + The key value pair. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and nullable value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + The default value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + if set to true [value]. + + + + + Appends the specified name and value to the end of this instance. + + The name. + if set to true [value]. + if set to true [default value]. + + + + + Appends the specified name and only the date of the passed . + + The name. + The value. + + + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The action. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The values. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The values. + + + + + Appends the object. + + The name. + The value. + + + + + Appends the specified name and Action or String specified in the ClientEvent object. + + The name. + Client event of the component. + + + + + Appends the specified name and value to the end of this instance. + + The type of the enum. + The name. + The value. + The default value. + + + + + Completes this instance. + + + + + Defines the factory to create . + + + + + Creates a writer. + + The id. + The type. + The text writer. + + + + + Defines the sort modes supported by + + + + + The user can sort only by one column at the same time. + + + + + The user can sort by more than one column at the same time. + + + + + Telerik Grid for ASP.NET MVC is a view component for presenting tabular data. + It supports the following features: + + Flexible databinding - server, ajax and web service + Paging, sorting and filtering + Light HTML and JavaScript footprint + + + The type of the data item which the grid is bound to. + + + + Initializes a new instance of the class. + + The view context. + The client side object writer factory. + The URL generator. + The builder factory. + + + + Gets the selection configuration + + + + + Gets the client events of the grid. + + The client events. + + + + Gets the filtering configuration. + + + + + Gets the web service configuration + + + + + Gets the server binding configuration. + + + + + Gets the scrolling configuration. + + + + + Gets the ajax configuration. + + + + + Gets or sets a value indicating whether custom binding is enabled. + + true if custom binding is enabled; otherwise, false. The default value is false + + + + Gets the paging configuration. + + + + + Gets the columns of the grid. + + + + + Gets or sets the data source. + + The data source. + + + + Gets the page size of the grid. + + + + + Gets the sorting configuration. + + The sorting. + + + + Gets or sets a value indicating whether to add the property of the grid as a prefix in url parameters. + + true if prefixing is enabled; otherwise, false. The default value is true + + + + Gets or sets the action executed when rendering a row. + + + + + Gets or sets the action executed when rendering a cell. + + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The component. + + + + Configures the grid resizing settings + + Resizing settings configurator method + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Resizable(resizing => resizing.Columns(true)) + %> + + + + + + Sets the localization culture of the grid. + + The culture. + + + <%= Html.Telerik().Grid<Order>() + .Name("Orders") + .Localizable("de-DE") + %> + + + + + + Configures the grid editing settings. + + Configurator for the edit settings. + + + <%= Html.Telerik().Grid<Order>() + .Name("Orders") + .Editable(settings => settings.Enabled(true)) + %> + + + + + + Configures the toolbar of the grid. + + ToolBar configurator. + + + <%= Html.Telerik().Grid<Order>() + .Name("Orders") + .ToolBar(commands => commands.Insert()) + %> + + + + + + Defines a list of the private keys. + + DataKeys configurator. + + + <%= Html.Telerik().Grid<Order>() + .Name("Orders") + .DataKeys(keys => + { + keys.Add(c => c.CustomerID); + }) + %> + + + + + + Configure when to show footer of the grid. + + If it is true, the future is visible. + + + + Binds the grid to a list of objects + + The type of the data item + The data source. + + + <%= Html.Telerik().Grid<Order>() + .Name("Orders") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]); + %> + + + + + + Callback for each row. + + Action, which will be executed for each row. + You can format the entire row + + + <%= Html.Telerik().Grid() + .Name("Grid") + .RowAction(row => + { + // "DataItem" is the Order object to which the current row is bound to + if (row.DataItem.Freight > 10) + { + //Set the background of the entire row + row.HtmlAttributes["style"] = "background:red;"; + } + }); + %> + + + + + + Callback for each cell. + + Action, which will be executed for each cell. + You can format a concrete cell. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .CellAction(cell => + { + if (cell.Column.Name == "Freight") + { + if (cell.DataItem.Freight > 10) + { + //Set the background of this cell only + cell.HtmlAttributes["style"] = "background:red;"; + } + } + }); + %> + + + + + + Enables or disables the custom binding of the grid. + + If true enables custom binding. + + + + + Defines the columns of the grid. + + The add action. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]); + %> + + + + + + Allows sorting of the columns. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Sortable(); + %> + + + + + + Allows sorting of the columns. + + Use builder to define sort settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Sortable(sorting => sorting.SortMode(GridSortMode.MultipleColumn) + %> + + + + + + Enables row selection. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Selectable() + %> + + + + + + Enables row selection. + + Use builder to define the selection settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Selectable(selection => selection.Enabled(true)) + %> + + + + + + Put grid name as a prefix. + + + + + Allows paging of the data. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Pageable(); + %> + + + + + + Allows paging of the data. + + Use builder to define paging settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Pageable(paging => + paging.PageSize(20) + .Style(GridPagerStyles.NextPreviousAndNumeric) + .Position(GridPagerPosition.Bottom) + ) + %> + + + + + + Use it to configure Server binding. + + Use builder to set different server binding settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .ServerBinding(serverBinding => serverBinding + .Action("Index", "Home", new {id = (string)ViewData["id"]}) + ) + .Pagealbe() + .Sortable(); + %> + + + + + + Use it to configure binding option when performing data operations - paging, sorting and filtering. + + Use builder to set different data binding options. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .DataBinding(dataBinding => + { + dataBinding.Server().Select("FirstLook", "Grid"}); + dataBinding.Ajax().Select("_FirstLook", "Grid").Enabled((bool)ViewData["ajax"]); + }) + .Pagealbe() + .Sortable(); + %> + + + + + + Use it to configure Ajax binding. + + Use builder to set different ajax binding settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_AjaxBinding", "Home")) + .Pagealbe() + .Sortable(); + %> + + + + + + Allows filtering of the columns. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Filterable(); + %> + + + + + + Allows filtering of the columns. + + Use builder to define filtering settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Filterable(filtering => filtering.Enabled(true); + %> + + + + + + Show scrollbar if there are many items. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Scrollable(); + %> + + + + + + Show scrollbar if there are many items. + + Use builder to define scrolling settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Scrollable(scrolling => scrolling.Enabled(true); + %> + + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .ClientEvents(events => events + .OnDataBinding("onDataBinding") + .OnRowDataBound("onRowDataBound") + ) + %> + + + + + + Use it to configure grouping. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Groupable(grouping => grouping.Enabled(true); + %> + + + + + + Allows grouping. + + + + <%= Html.Telerik().Grid() + .Name("Grid") + .Ajax(ajax => ajax.Action("_RelatedGrids_Orders", "Grid", new { customerID = "ALFKI" })) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + .BindTo((IEnumerable<Order>)ViewData["Orders"]) + .Groupable(); + %> + + + + + + Use it to configure web service binding. + + Use builder to set different web service binding settings. + + + <%= Html.Telerik().Grid() + .Name("Grid") + .WebService(webService => webService.Url("~/Models/Orders.asmx/GetOrders")) + .Columns(columns=> + { + columns.Add(c => c.OrderID).Width(100); + columns.Add(c => c.OrderDate).Width(200).Format("{0:dd/MM/yyyy}"); + columns.Add(c => c.ShipAddress); + columns.Add(c => c.ShipCity).Width(200); + }) + %> + + + + + + Creates columns for the . + + The type of the data item to which the grid is bound to + + + + Initializes a new instance of the class. + + The container. + + + + Defines a bound column. + + + + + + + + Defines a bound column. + + + + + + + + Defines a bound column. + + + + + Defines a bound column. + + + + + Defines a template column. + + + + + + + Defines a template column. + + + + + + + Defines a command column. + + + + + + + Used for action methods when using Ajax or Custom binding + + + + + Initializes a new instance of the class. + + + + + Gets or sets the name of the action parameter. The default value is "command". + + The name of the action parameter. + + + [GridAction(ActionParameterName="param")] + public ActionResult Index(GridCommand param) + { + } + + + + + + Gets or sets the name of the Grid that is populated by the associated action method. Required + when custom server binding is enabled and the grid query string parameters are prefixed. + + + + [GridAction(EnableCustomBinding=true, GridName="Employees")] + public ActionResult Index(GridCommand param) + { + } + + + + + + Gets or sets a value indicating whether custom binding is enabled. Used when implementing custom ajax binding. + + true if custom binding is enabled; otherwise, false. The default value is false. + + + [GridAction(EnableCustomBinding=true)] + public ActionResult Index(GridCommand param) + { + } + + + + + + Defines the fluent interface for configuring + + + + + Initializes a new instance of the class. + + The pager. + + + + Sets the position at which to display the pager. + + The pager position. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Pageable(paging => paging.Position(GridPagerPosition.Bottom)) + %> + + + + + + Sets the page size of the grid. + + The number of items to display in a single page. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Pageable(paging => paging.PageSize(20)) + %> + + + + + + Sets the pager style. + + The pager style to set. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Pageable(paging => paging.Style(GridPagerStyles.PageInput | GridPagerStyles.Numeric)) + %> + + + + + + Sets the total number of items in the data source. Required during Custom binding. + + The value. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Pageable(paging => paging.Total((int)ViewData["total"])) + %> + + + + + + Enables or disables paging. + + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + .Pageable(paging => paging.Enabled((bool)ViewData["enablePaging"])) + %> + + + + The Enabled method is useful when you need to enable paging based on certain conditions. + + + + + Defines methods to manipulate generic link object collections. + + + + + + Initializes a new instance of the class. + + The parent. + + + + Adds an item to the . + + The object to add to the . + The is read-only. + + + + Removes all items from the . + + The is read-only. + + + + Determines whether the contains a specific value. + + The object to locate in the . + + true if is found in the ; otherwise, false. + + + + + Copies the elements of the to an , starting at a particular index. + + The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. + The zero-based index in at which copying begins. + + is null. + + + is less than 0. + + + is multidimensional. + -or- + is equal to or greater than the length of . + -or- + The number of elements in the source is greater than the available space from to the end of the destination . + -or- + Type cannot be cast automatically to the type of the destination . + + + + + Returns an enumerator that iterates through the collection. + + + A that can be used to iterate through the collection. + + + + + Determines the index of a specific item in the . + + The object to locate in the . + + The index of if found in the list; otherwise, -1. + + + + + Inserts an item to the at the specified index. + + The zero-based index at which should be inserted. + The object to insert into the . + + is not a valid index in the . + The is read-only. + + + + Removes the first occurrence of a specific object from the . + + The object to remove from the . + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + The is read-only. + + + + Removes the item at the specified index. + + The zero-based index of the item to remove. + + is not a valid index in the . + The is read-only. + + + + Gets or sets the T object that is the parent of the current node. + + The parent. + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + Gets a value indicating whether the is read-only. + + + true if the is read-only; otherwise, false. + + + + Gets or sets the at the specified index. + + + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The component. + + + + Defines the items in the menu + + The add action. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => + events.OnOpen("onOpen").OnClose("onClose") + ) + %> + + + + + + Sets the menu orientation. + + The desired orientation. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Orientation(MenuOrientation.Vertical) + %> + + + + + + Enables or disables the "open-on-click" feature. + + + + <%= Html.Telerik().Menu() + .Name("Menu") + .OpenOnClick(true) + %> + + + + + + Sets the theme of the menu + + + + + Binds the menu to a sitemap + + The view data key. + The action to configure the item. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .BindTo("examples", (item, siteMapNode) => + { + }) + %> + + + + + + Binds the menu to a sitemap. + + The view data key. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .BindTo("examples") + %> + + + + + + Binds the menu to a list of objects. The menu will be "flat" which means a menu item will be created for + every item in the data source. + + The type of the data item + The data source. + The action executed for every data bound item. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .BindTo(new []{"First", "Second"}, (item, value) + { + item.Text = value; + }) + %> + + + + + + Binds the menu to a list of objects. The menu will create a hierarchy of items using the specified mappings. + + The type of the data item + The data source. + The action which will configure the mappings + + + <%= Html.Telerik().Menu() + .Name("Menu") + .BindTo(Model, mapping => mapping + .For<Customer>(binding => binding + .Children(c => c.Orders) // The "child" items will be bound to the the "Orders" property + .ItemDataBound((item, c) => item.Text = c.ContactName) // Map "Customer" properties to MenuItem properties + ) + .For<Order<(binding => binding + .Children(o => null) // "Orders" do not have child objects so return "null" + .ItemDataBound((item, o) => item.Text = o.OrderID.ToString()) // Map "Order" properties to MenuItem properties + ) + ) + %> + + + + + + Configures the effects of the menu. + + The action which configures the effects. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Effects(fx => + { + fx.Slide() + .Opacity() + .OpenDuration(AnimationDuration.Normal) + .CloseDuration(AnimationDuration.Normal); + }) + + + + + + Selects the item at the specified index. + + The index. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + .SelectedIndex(1) + %> + + + + + + Callback for each item. + + Action, which will be executed for each item. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .ItemAction(item => + { + item + .Text(...) + .HtmlAttributes(...); + }) + %> + + + + + + Select item depending on the current URL. + + If true the item will be highlighted. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .HighlightPath(true) + %> + + + + + + Defines the fluent interface for configuring child menu items. + + + + + Initializes a new instance of the class. + + The item. + + + + Configures the child items of a . + + The add action. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }); + }) + %> + + + + + + Specifies the orientation in which the menu items will be ordered + + + + + Items are oredered horizontally + + + + + Items are oredered vertically + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The client events. + The view context. + + + + Defines the inline handler of the OnOpen client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnOpen(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnOpen client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnOpen("onOpen")) + %> + + + + + + Defines the inline handler of the OnClose client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnClose(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnClose client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnClose("onClose")) + %> + + + + + + Defines the inline handler of the OnSelect client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnSelect(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnSelect("onSelect")) + %> + + + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Menu() + .Name("Menu") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + INavigatable extension for providing access to . + + + + + Sets the action and controller name, along with Route values of object. + + The object. + Action name. + Controller name. + Route values as an object + + + + Sets the action, controller name and route values of object. + + The object. + Action name. + Controller name. + Route values as + + + + Sets the url property of object. + + The object. + The Url. + + + + Sets the route name and route values of object. + + The object. + Route name. + Route values as an object. + + + + Sets the route name and route values of object. + + The object. + Route name. + Route values as . + + + + Generating url depending on the ViewContext and the generator. + + The object. + The object + The generator. + + + + Generating url depending on the ViewContext and the generator. + + The object. + The object + The generator. + + + + Verify whether the object is accessible. + + The object. + The object. + The object + + + + Verifies whether collection of objects is accessible. + + Object of type. + The object. + The object. + The object + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The component. + + + + Defines the items in the panelbar + + The add action. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + Sets the theme of the panelbar + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => + events.OnExpand("onExpand").OnCollapse("onCollapse") + ) + %> + + + + + + Binds the panelbar to a sitemap + + The view data key. + The action to configure the item. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .BindTo("examples", (item, siteMapNode) => + { + }) + %> + + + + + + Binds the panelbar to a sitemap. + + The view data key. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .BindTo("examples") + %> + + + + + + Binds the panelbar to a list of objects + + The type of the data item + The data source. + The action executed for every data bound item. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .BindTo(new []{"First", "Second"}, (item, value) + { + item.Text = value; + }) + %> + + + + + + Binds the panelbar to a list of objects. The panelbar will create a hierarchy of items using the specified mappings. + + The type of the data item + The data source. + The action which will configure the mappings + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .BindTo(Model, mapping => mapping + .For<Customer>(binding => binding + .Children(c => c.Orders) // The "child" items will be bound to the the "Orders" property + .ItemDataBound((item, c) => item.Text = c.ContactName) // Map "Customer" properties to PanelBarItem properties + ) + .For<Order<(binding => binding + .Children(o => null) // "Orders" do not have child objects so return "null" + .ItemDataBound((item, o) => item.Text = o.OrderID.ToString()) // Map "Order" properties to PanelBarItem properties + ) + ) + %> + + + + + + Configures the effects of the panelbar. + + The action which configures the effects. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Effects(fx => + { + fx.Height() + .Opacity() + .OpenDuration(AnimationDuration.Normal) + .CloseDuration(AnimationDuration.Normal); + }) + + + + + + Callback for each item. + + Action, which will be executed for each item. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ItemAction(item => + { + item + .Text(...) + .HtmlAttributes(...); + }) + %> + + + + + + Select item depending on the current URL. + + If true the item will be highlighted. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .HighlightPath(true) + %> + + + + + + Renders the panelbar with expanded items. + + If true the panelbar will be expanded. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ExpandAll(true) + %> + + + + + + Sets the expand mode of the panelbar. + + The desired expand mode. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ExpandMode(PanelBarExpandMode.Multiple) + %> + + + + + + Selects the item at the specified index. + + The index. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + .SelectedIndex(1) + %> + + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The client events. + The view context. + + + + Defines the inline handler of the OnExpand client-side event + + The action defining the inline handler. + + + <% Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnExpand(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnExpand client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnExpand("onExpand")) + %> + + + + + + Defines the inline handler of the OnCollapse client-side event + + The action defining the inline handler. + + + <% Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnCollapse(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnCollapse client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnCollapse("onCollapse")) + %> + + + + + + Defines the inline handler of the OnSelect client-side event + + The action defining the inline handler. + + + <% Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnSelect(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnSelect("onSelect")) + %> + + + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the inline handler of the OnError client-side event + + The action defining the inline handler. + + + <% Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnError(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnError client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .ClientEvents(events => events.OnError("onError")) + %> + + + + + + Specifies the expand mode in which the panelbar will expand its items + + + + + Only one item can be expanded. + + + + + All items can be expanded + + + + + Defines the fluent interface for configuring child panelbar items. + + + + + Initializes a new instance of the class. + + The item. + The context of the View. + + + + Configures the child items of a . + + The add action. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }); + }) + %> + + + + + + Define when the item will be expanded on intial render. + + If true the item will be expanded. + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(items => + { + items.Add().Text("First Item").Items(firstItemChildren => + { + firstItemChildren.Add().Text("Child Item 1"); + firstItemChildren.Add().Text("Child Item 2"); + }) + .Expanded(true); + }) + %> + + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The client events. + The view context. + + + + Defines the inline handler of the OnSelect client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TabStrip() + .Name("TabStrip") + .ClientEvents(events => events.OnSelect(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnSelect client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .ClientEvents(events => events.OnSelect("onSelect")) + %> + + + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TabStrip() + .Name("TabStrip") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the inline handler of the OnError client-side event + + The action defining the inline handler. + + + <% Html.Telerik().TabStrip() + .Name("TabStrip") + .ClientEvents(events => events.OnError(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnError client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .ClientEvents(events => events.OnError("onError")) + %> + + + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The component. + + + + Defines the items in the tabstrip + + The add action. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .ClientEvents(events => + events.OnSelect("onSelect").OnLoad("onLoad") + ) + %> + + + + + + Binds the tabstrip to a sitemap + + The view data key. + The action to configure the item. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .BindTo("examples", (item, siteMapNode) => + { + }) + %> + + + + + + Binds the tabstrip to a sitemap. + + The view data key. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .BindTo("examples") + %> + + + + + + Binds the tabstrip to a list of objects + + The type of the data item + The data source. + The action executed for every data bound item. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .BindTo(new []{"First", "Second"}, (item, value) + { + item.Text = value; + }) + %> + + + + + + Configures the effects of the tabstrip. + + The action which configures the effects. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .Effects(fx => + { + fx.Slide() + .Opacity() + .OpenDuration(AnimationDuration.Normal) + .CloseDuration(AnimationDuration.Normal); + }) + + + + + + Selects the item at the specified index. + + The index. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + .SelectedIndex(1) + %> + + + + + + Callback for each item. + + Action, which will be executed for each item. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .ItemAction(item => + { + item + .Text(...) + .HtmlAttributes(...); + }) + %> + + + + + + Select item depending on the current URL. + + If true the item will be highlighted. + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .HighlightPath(true) + %> + + + + + + Defines the fluent interface for configuring child tabstrip items. + + + + + Initializes a new instance of the class. + + The item. + The context of the View. + + + + Contains constants for CSS class names + + + + + Active state of items + + + + + Button + + + + + Content - rendered around custom content + + + + + Default state of items + + + + + Disabled state of items + + + + + Group - rendered around grouped items (children) + + + + + Header - rendered on headers or header items + + + + + Hovered state of items + + + + + Icon - icon from default icon set + + + + + Image - image rendered through ImageUrl + + + + + Item - rendered on items + + + + + First in list of items + + + + + Last in list of items + + + + + Top in list of items + + + + + Bottom in list of items + + + + + Middle in list of items + + + + + Last in list of headers + + + + + Link - rendered on all links + + + + + Reset - removes inherited styles + + + + + Selected state of items + + + + + Sprite - sprite rendered in the begging of the item. + + + + + Widget - rendered always on the outmost HTML element of a UI component + + + + + Input - input rendered in the div wrapper + + + + + CheckBox - rendered on all checkbox + + + + + ToolBar - rendered on all toolbars + + + + + Contains CSS classes, used in the Grid + + + + + Contains CSS classes, used in the Grid + + + + + Grid action + + + + + Grid action + + + + + Container element for editing / inserting form + + + + + Container element for editing / inserting form + + + + + Toolbar which contains different commands + + + + + Class that shows treeview lines + + + + + Editor toolbar button + + + + + Editor toolbar color picker + + + + + Editor tool icon + + + + + Defines the basic building block of web asset merging. + + + + + Merges the specified assets. + + Type of the content. + The asset handler path. + if set to true [is secured]. + if set to true [can compress]. + The assets. + + + + + Merges the specified asset group. + + Type of the content. + The asset handler path. + if set to true [is secured]. + if set to true [can compress]. + The asset group. + + + + + Enables zoom animation. + + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The client events. + The view context. + + + + Defines the inline handler of the OnLoad client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnLoad(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnLoad client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnLoad("onLoad")) + %> + + + + + + Defines the inline handler of the OnOpen client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnOpen(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnOpen client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnOpen("onOpen")) + %> + + + + + + Defines the inline handler of the OnClose client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnClose(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnClose client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnClose("onClose")) + %> + + + + + + Defines the inline handler of the OnMove client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnMove(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnMove client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnMove("onMove")) + %> + + + + + + Defines the inline handler of the OnResize client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnResize(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnResize client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnResize("onResize")) + %> + + + + + + Defines the inline handler of the OnRefresh client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnRefresh(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnRefresh client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnRefresh("onRefresh")) + %> + + + + + + Defines the inline handler of the OnError client-side event + + The action defining the inline handler. + + + <% Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnError(() => + { + %> + function(e) { + //event handling code + } + <% + })) + .Render(); + %> + + + + + + Defines the name of the JavaScript function that will handle the the OnError client-side event. + + The name of the JavaScript function that will handle the event. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => events.OnError("onError")) + %> + + + + + + Sets path to the icon. + + Path to the icon. + + + <%= Html.Telerik().Window() + .Name("Window") + .Icon(Url.Content("~/Content/Icons/WindowIcon.png")) + %> + + + + + + Sets path and alternative text to the icon. + + Path to the icon. + Alternative text to the icon. + + + <%= Html.Telerik().Window() + .Name("Window") + .Icon(Url.Content("~/Content/Icons/WindowIcon.png"), "icon") + %> + + + + + + Sets title, which appears in the header of the window. + + + + + Sets the HTML content which the window should display. + + The action which renders the content. + + + <% Html.Telerik().Window() + .Name("Window") + .Content(() => + { + %> + <strong> First Item Content</strong> + <% + }) + %> + + + + + + Sets the HTML content which the window should display + + The Razor inline template + + + @(Html.Telerik().Window() + .Name("Window") + .Content(@<strong> Hello World!!!</strong>)) + + + + + + + Sets the HTML content which the item should display as a string. + + The action which renders the content. + + <%= Html.Telerik().Window() + .Name("Window") + .Content("<strong> First Item Content</strong>") + %> + + + + + Sets the HTML attributes of the content element of the item. + + The attributes. + + + <%= Html.Telerik().Window() + .Name("Window") + .Content(() => { %> <strong>First Item Content</strong> <% }) + .ContentHtmlAttributes(new {@class="first-item-content"}) + %> + + + + + + Sets the Url, which will be requested to return the content. + + The action name. + The controller name. + + + <%= Html.Telerik().Window() + .Name("Window") + .LoadContentFrom("AjaxView_OpenSource", "Window") + %> + + + + + + Sets the Url, which will be requested to return the content. + + The action name. + The controller name. + Route values. + + + <%= Html.Telerik().Window() + .Name("Window") + .LoadContentFrom("AjaxView_OpenSource", "Window", new { id = 10}) + %> + + + + + + Sets the Url, which will be requested to return the content. + + The url. + + + <%= Html.Telerik().Window() + .Name("Window") + .LoadContentFrom(Url.Action("AjaxView_OpenSource", "Window")) + %> + + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => + events.OnOpen("onOpen").OnClose("onClose") + ) + %> + + + + + + Enables windows resizing. + + + + <%= Html.Telerik().Window() + .Name("Window") + .Resizable() + %> + + + + + + Configures the resizing ability of the window. + + Resizing settings action. + + + <%= Html.Telerik().Window() + .Name("Window") + .Resizable(settings => + settings.Enabled(true).MaxHeight(500).MaxWidth(500) + ) + %> + + + + + + Configures the client-side events. + + The client events action. + + + <%= Html.Telerik().Window() + .Name("Window") + .ClientEvents(events => + events.OnOpen("onOpen").OnClose("onClose") + ) + %> + + + + + + Sets the width of the window. + + + + + Sets the height of the window. + + + + + Sets whether the window should be rendered visible. + + + + + Sets whether the window should have scrollbars. + + + + + Configures the effects of the window. + + The action which configures the effects. + + + <%= Html.Telerik().Window() + .Name("Window") + .Effects(fx => + { + fx.Zoom() + .Opacity() + .OpenDuration(AnimationDuration.Fast) + .CloseDuration(AnimationDuration.Fast); + }) + + + + + + Sets whether the window should be modal or not. + + + + + Sets whether the window can be moved. + + + + + Defines basic building blocks of Global storage for web assets. + + + + + Basic building block to locate the correct virtual path. + + + + + Returns the correct virtual path based upon the debug mode and version. + + The virtual path. + The version. + + + + + Stores the specified asset group. + + Type of the content. + The asset group. + + + + + Retrieves the web asset by specified id. + + The id. + + + + + Builder class for fluently configuring the shared group. + + + + + Initializes a new instance of the class. + + The default path. + The assets. + + + + Adds the group. + + The name. + The configure action. + + + + + Gets the group. + + The name. + The configure action. + + + + + + + + + + Executes the provided delegate that is used to configure stylesheets. + + The configure action. + + + + Executes the provided delegate that is used to configure scripts. + + The configure action. + + + + The web asset Configuration. + + + + + Gets the name of the section. + + The name of the section. + + + + Gets or sets a value indicating whether to use telerik content delivery network. + + + true if [use telerik content delivery network]; otherwise, false. + + + + + Gets the style sheets. + + The style sheets. + + + + Gets the scripts. + + The scripts. + + + + Web asset item configuration element. + + + + + Gets or sets the source. + + The source. + + + + Web asset item configuration collection. + + + + + Adds the specified element. + + The element. + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + The to return the key for. + + An that acts as the key for the specified . + + + + + Gets the with the specified source. + + + + + + Web asset group configuration element. + + + + + Gets or sets the name. + + The name. + + + + Gets or sets the default path. + + The default path. + + + + Gets or sets a value indicating whether to use telerik content delivery network. + + + true if [use telerik content delivery network]; otherwise, false. + + + + + Gets or sets the content delivery network URL. + + The content delivery network URL. + + + + Gets or sets a value indicating whether this is enabled. + + true if enabled; otherwise, false. + + + + Gets or sets the version. + + The version. + + + + Gets or sets a value indicating whether this is compress. + + true if compress; otherwise, false. + + + + Gets or sets the cache duration in days. + + The cache duration in days. + + + + Gets or sets a value indicating whether this is combined. + + true if combined; otherwise, false. + + + + Gets the items. + + The items. + + + + Web asset group configuration collection + + + + + Adds the specified element. + + The element. + + + + When overridden in a derived class, creates a new . + + + A new . + + + + + Gets the element key for a specified configuration element when overridden in a derived class. + + The to return the key for. + + An that acts as the key for the specified . + + + + + Gets the with the specified name. + + + + + + Reprenets an web asset. + + + + + Initializes a new instance of the class. + + Type of the content. + The version. + if set to true [compress]. + The cache duration in days. + The content. + + + + Gets the type of the content. + + The type of the content. + + + + Gets the version. + + The version. + + + + Gets a value indicating whether this is compressed. + + true if compress; otherwise, false. + + + + Gets the cache duration in days. + + The cache duration in days. + + + + Gets the content. + + The content. + + + + The HttpHandler to compress, cache and combine web assets. + + + + + Initializes a new instance of the class. + + The asset registry. + The HTTP response compressor. + The HTTP response cacher. + + + + Initializes a new instance of the class. + + + + + Enables a WebAssetHttpHandler object to process of requests. + + The context. + + + + Gets or sets the default path of the asset. + + The default path. + + + + Gets or sets the name of the id parameter. + + The name of the id parameter. + + + + Default web asset locator. + + + + + Returns the correct virtual path based upon the debug mode and version. + + The virtual path. + The version. + + + + + The default web asset registry. + + + + + Initializes a new instance of the class. + + if set to true [is in debug mode]. + The cache manager. + The asset locator. + The URL resolver. + The path resolver. + The virtual path provider. + + + + Stores the specified asset group. + + Type of the content. + The asset group. + + + + + Retrieves the web asset by specified id. + + The id. + + + + + Returns the correct virtual path based upon the debug mode and version. + + The virtual path. + The version. + + + + + Contains default asset settings. + + + + + Gets or sets the style sheet files path. Path must be a virtual path. + + The style sheet files path. + + + + Gets or sets the script files path. Path must be a virtual path. + + The script files path. + + + + Gets or sets the version. + + The version. + + + + Gets or sets a value indicating whether assets should be served as compressed. + + true if compress; otherwise, false. + + + + Gets or sets a value indicating whether assets shoule be combined. + + true if combined; otherwise, false. + + + + Gets or sets the cache duration in days. + + The cache duration in days. + + + + Gets or sets a value indicating whether [use telerik content delivery network]. + + + true if [use telerik content delivery network]; otherwise, false. + + + + + Defines members that a class must implement in order to provide helper methods for resolving virtual path. + + + + + Returns the physical path for the specified virtual path. + + The virtual path. + + + + + Defines members that a class must implement in order to compress the response. + + + + + Compresses the response. + + The context. + + + + Defines members that must be implemented for cache the http response + + + + + Caches the response for the specified duration. + + The context. + The duration. + + + + Defines members that a class must implement in order to access file system. + + + + + Determines whether the specified directory exists. + + The path. + + + + + Determines whether the specified file exists. + + The path. + + + + + Gets the files in the specified locations. + + The path. + The search pattern. + if set to true [recursive]. + + + + + Reads the content of the specified file. + + The path. + + + + + Defines the read operaations of configuration. + + + + + Gets the section with the specified name. + + + Name of the section. + + + + + Defines members that a class must implement in order to access System.Web.HttpRuntime.Cache object. + + + + + Gets the item. + + The key. + + + + + Inserts the specified key. + + The key. + The value. + The on remove callback. + The file dependencies. + + + + Contains extension methods of T[]. + + + + + Determines whether the specified array is empty or null. + + + The instance. + + true if [is null or empty] [the specified instance]; otherwise, false. + + + + + Determines whether the specified array is empty. + + + The instance. + + true if the specified instance is empty; otherwise, false. + + + + + Encapsulates the System.Web.HttpRuntime.Cache object that contains methods for accessing System.Web.HttpRuntime.Cache object. + + + + + Retrieves the specified item from the System.Web.HttpRuntime.Cache object. + + The object to be retrives from the cache. + + + + + Inserts an object into the System.Web.Caching.Cache object with dependencies and a delegate you can use to notify your application when the inserted item is removed from the Cache. + + The object to be inserted in the cache. + The file or cache key dependencies for the item. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this parameter contains null. + A delegate that, if provided, will be called when an object is removed from the cache. You can use this to notify applications when their objects are deleted from the cache. + List of files that the cache item depends upon, if any of the file is changed the cache item will become invalid. + + + + Defines the factory to create . + + + + + Creates a writer. + + The id. + The type. + The text writer. + + + + + Provides an attribute to change the enum value for client side. + + + + + Initializes a new instance of the class with the specified value for the client side. + + The value. + + + + Gets or sets the value for client side. + + The value. + + + + Contains extension methods of ICollection<T>. + + + + + Determines whether the specified collection instance is null or empty. + + + The instance to check. + + true if the specified instance is null or empty; otherwise, false. + + + + + Determines whether the specified collection is empty. + + + The instance. + + true if the specified instance is empty; otherwise, false. + + + + + Adds the specified elements to the end of the System.Collections.Generic.ICollection<T>. + + + The instance to add. + The collection whose elements should be added to the end of the ICollection<T>. The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type. + + + + Encapsulates the ConfigurationManager object that contains methods for accessing System.Web.HttpRuntime.Cache object. + + + + + Gets the section with the specified name. + + + Name of the section. + + + + + Contains extension methods of IDictionary<string, objectT>. + + + + + Merges the specified instance. + + The instance. + The key. + The value. + if set to true [replace existing]. + + + + Appends the in value. + + The instance. + The key. + The separator. + The value. + + + + Appends the specified value at the beginning of the existing value + + + + + + + + + Toes the attribute string. + + The instance. + + + + + Merges the specified instance. + + The instance. + From. + if set to true [replace existing]. + + + + Merges the specified instance. + + The instance. + From. + + + + Merges the specified instance. + + The instance. + The values. + if set to true [replace existing]. + + + + Merges the specified instance. + + The instance. + The values. + + + + Provides properties and methods for working with drives, files, and directories. + + + + + Determines whether the given path refers to an existing directory on disk. + + The path to test. + true if path refers to an existing directory; otherwise, false. + + + + Determines whether the specified file exists. + + The file to check. + true if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false if path is null, an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path. + + + + Returns the names of files in the specified directory that match the specified search pattern, using a value to determine whether to search subdirectories. + + The directory to search. + The search string to match against the names of files in path. The parameter cannot end in two periods ("..") or contain two periods ("..") followed by System.IO.Path.DirectorySeparatorChar or System.IO.Path.AltDirectorySeparatorChar, nor can it contain any of the characters in System.IO.Path.InvalidPathChars. + if set to true the search operation should include all subdirectories or only the current directory. + A String array containing the names of files in the specified directory that match the specified search pattern. File names include the full path. + + + + Opens a text file, reads all lines of the file, and then closes the file. + + The file to open for reading. + A string containing all lines of the file. + + + + Contains extension methods of . + + + + + Requests the context. + + The instance. + + + + + Gets a value indicating whether we're running under Mono. + + true if Mono; otherwise, false. + + + + Gets a value indicating whether we're running under Linux or a Unix variant. + + true if Linux/Unix; otherwise, false. + + + + Class used to cache the http response. + + + + + Set the caching policy. + + The context. + The duration. + + + + Encapsulates the HTTP intrinsic object that compress the response + + + + + Compresses the response. + + The context. + + + + Class use to resolve physical path for virtual path. + + + + + Returns the physical path for the specified virtual path. + + The virtual path. + + + + + Helper class for argument validation. + + + + + Ensures the specified argument is not null. + + The parameter. + Name of the parameter. + + + + Ensures the specified string is not blank. + + The parameter. + Name of the parameter. + + + + Ensures the specified array is not null or empty. + + + The parameter. + Name of the parameter. + + + + Ensures the specified collection is not null or empty. + + + The parameter. + Name of the parameter. + + + + Ensures the specified value is a positive integer. + + The parameter. + Name of the parameter. + + + + Ensures the specified value is not a negative integer. + + The parameter. + Name of the parameter. + + + + Ensures the specified value is not a negative float. + + The parameter. + Name of the parameter. + + + + Ensures the specified path is a virtual path which starts with ~/. + + The parameter. + Name of the parameter. + + + + Contains extension methods of . + + + + + Starts thread safe read write code block. + + The instance. + + + + + Starts thread safe read code block. + + The instance. + + + + + Starts thread safe write code block. + + The instance. + + + + + Contains the extension methods of . + + + + + Replaces the format item in a specified System.String with the text equivalent of the value of a corresponding System.Object instance in a specified array. + + A string to format. + An System.Object array containing zero or more objects to format. + A copy of format in which the format items have been replaced by the System.String equivalent of the corresponding instances of System.Object in args. + + + + Determines whether this instance and another specified System.String object have the same value. + + The string to check equality. + The comparing with string. + + true if the value of the comparing parameter is the same as this string; otherwise, false. + + + + + Determines whether this instance and another specified System.String object have the same value. + + The string to check equality. + The comparing with string. + + true if the value of the comparing parameter is the same as this string; otherwise, false. + + + + + Determines whether this instance is null or empty string. + + The string to check its value. + + true if the value is null or empty string; otherwise, false. + + + + + Compresses the specified instance. + + The instance. + + + + + Decompresses the specified instance. + + The instance. + + + + + A strongly-typed resource class, for looking up localized strings, etc. + + + + + Returns the cached ResourceManager instance used by this class. + + + + + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. + + + + + Looks up a localized string similar to "{0}" array cannot be empty.. + + + + + Looks up a localized string similar to "{0}" cannot be negative.. + + + + + Looks up a localized string similar to "{0}" cannot be negative or zero.. + + + + + Looks up a localized string similar to "{0}" cannot be null.. + + + + + Looks up a localized string similar to "{0}" cannot be null or empty.. + + + + + Looks up a localized string similar to Cannot find a public property of primitive type to sort by.. + + + + + Looks up a localized string similar to Cannot have more one column in order when sort mode is set to single column.. + + + + + Looks up a localized string similar to Cannot route to class named 'Controller'.. + + + + + Looks up a localized string similar to Cannot use Ajax and WebService binding at the same time.. + + + + + Looks up a localized string similar to Cannot use only server templates in Ajax or WebService binding mode. Please specify a client template as well.. + + + + + Looks up a localized string similar to "{0}" collection cannot be empty.. + + + + + Looks up a localized string similar to Multiple types were found that match the controller named '{0}'. This can happen if the route that services this request does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter. + + The request for '{0}' has found the following matching controllers:{1}. + + + + + Looks up a localized string similar to Multiple types were found that match the controller named '{0}'. This can happen if the route that services this request ('{1}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter. + + The request for '{0}' has found the following matching controllers:{2}. + + + + + Looks up a localized string similar to Controller name must end with 'Controller'.. + + + + + Looks up a localized string similar to The DataKeys collection is empty. Please specify a data key.. + + + + + Looks up a localized string similar to Date should be bigger than MinDate and less than MaxDate.. + + + + + Looks up a localized string similar to The Delete data binding setting is required by the delete command. Please specify the Delete action or url in the DataBinding configuration.. + + + + + Looks up a localized string similar to The Update data binding setting is required by the edit command. Please specify the Update action or url in the DataBinding configuration.. + + + + + Looks up a localized string similar to Group with specified name already exists.. + + + + + Looks up a localized string similar to Group with specified name "{0}" already exists. Please specify a different name.. + + + + + Looks up a localized string similar to Group with "{0}" does not exist in {1} SharedWebAssets.. + + + + + Looks up a localized string similar to Group with specified name "{0}" does not exist. Please make sure you have specified a correct name.. + + + + + Looks up a localized string similar to Provided index is out of range.. + + + + + Looks up a localized string similar to The Insert data binding setting is required by the insert command. Please specify the Insert action or url in the DataBinding configuration.. + + + + + Looks up a localized string similar to Item with specified source already exists.. + + + + + Looks up a localized string similar to Local group with name "{0}" already exists.. + + + + + Looks up a localized string similar to Bound columns require a field or property access expression.. + + + + + Looks up a localized string similar to MinDate should be less than MaxDate.. + + + + + Looks up a localized string similar to MinHeight should be less than MaxHeight.. + + + + + Looks up a localized string similar to MinValue should be less than MaxValue. + + + + + Looks up a localized string similar to MinWidth should be less than MaxWidth.. + + + + + Looks up a localized string similar to Name cannot be blank.. + + + + + Looks up a localized string similar to "None" is only used for internal purpose.. + + + + + Looks up a localized string similar to Only one ScriptRegistrar is allowed in a single request.. + + + + + Looks up a localized string similar to Only one StyleSheetRegistrar is allowed in a single request.. + + + + + Looks up a localized string similar to Only property and field expressions are supported. + + + + + Looks up a localized string similar to {0} should be bigger than {1} and less then {2}. + + + + + Looks up a localized string similar to You must have SiteMap defined with key "{0}" in ViewData dictionary.. + + + + + Looks up a localized string similar to Source must be a virtual path which should starts with "~/". + + + + + Looks up a localized string similar to Specified file does not exist: "{0}".. + + + + + Looks up a localized string similar to Passed string cannot be parsed to DateTime object.. + + + + + Looks up a localized string similar to The specified method is not an action method.. + + + + + Looks up a localized string similar to You cannot set Url and ContentUrl at the same time.. + + + + + Looks up a localized string similar to Value should be bigger than MinValue and less than MaxValue.. + + + + + Looks up a localized string similar to The Url of the WebService must be set. + + + + + Looks up a localized string similar to You cannot add more than once column when sort mode is set to single column.. + + + + + Looks up a localized string similar to You cannot call render more than once.. + + + + + Looks up a localized string similar to You cannot call Start more than once.. + + + + + Looks up a localized string similar to You cannot configure a shared web asset group.. + + + + + Looks up a localized string similar to You must have to call Start prior calling this method.. + + + + + Defines an individual web asset. + + + + + Marker interface of web asset. + + + + + Initializes a new instance of the class. + + + + + Gets the source. + + The source. + + + + Represents a list of that can be accessed by index. Provides methods to search, sort and manipulate lists. + + + + + Initializes a new instance of the class. + + The default path. + + + + Finds the group with the specified name. + + The name. + + + + + Finds the item with the specified source. + + The source. + + + + + Adds the specified source as . + + The item source. + + + + Adds the specified source as in the specified . + + Name of the group. + The item source. + + + + Inserts the specified source as at the specified index. + + The index. + The item source. + + + + Inserts the specified source as at the specified index in the specified . + + The index. + Name of the group. + The item source. + + + + Inserts an element into the at the specified index. + + The zero-based index at which should be inserted. + The object to insert. The value can be null for reference types. + + is less than zero. + -or- + is greater than . + + + + + Replaces the element at the specified index. + + The zero-based index of the element to replace. + The new value for the element at the specified index. The value can be null for reference types. + + is less than zero. + -or- + is greater than . + + + + + Gets or sets the default path. + + The default path. + + + + Gets the asset groups. + + The asset groups. + + + + Gets the asset items. + + The asset items. + + + + Defines the fluent interface for configuring web assets. + + + + + Initializes a new instance of the class. + + Type of the asset. + The assets. + + + + Performs an implicit conversion from to . + + The builder. + The result of the conversion. + + + + Returns the internal collection. + + + + + + Adds a new web asset + + The source. + + + <%= Html.Telerik().ScriptRegistrar() + .Scripts(scripts => scripts.Add("script1.js")) + %> + + + + + + Adds a new web asset group. + + The name. + The configure action. + + + <%= Html.Telerik().ScriptRegistrar() + .Scripts(scripts => scripts.AddGroup("Group1", group => + { + group.Add("script1.js"); + } + )) + %> + + + + + + Adds the specified shared group. + + The name. + + + <%= Html.Telerik().ScriptRegistrar() + .Scripts(scripts => scripts.AddShareGroup("SharedGroup1")) + %> + + + + + + Executes the provided delegate that is used to configure the group fluently. + + The name. + The configure action. + + + + Defines the group. + + + + + Initializes a new instance of the class. + + The name. + if set to true [is shared]. + + + + Gets or sets the name. + + The name. + + + + Gets or sets a value indicating whether this instance is shared. + + true if this instance is shared; otherwise, false. + + + + Gets or sets the default path. + + The default path. + + + + Gets or sets a value indicating whether Telerik content delivery network would be used. + + + true if [use Telerik content delivery network]; otherwise, false. + + + + + Gets or sets the content delivery network URL. + + The content delivery network URL. + + + + Gets or sets a value indicating whether this is disabled. + + true if disabled; otherwise, false. + + + + Gets or sets the version. + + The version. + + + + Gets or sets a value indicating whether this is compress. + + true if compress; otherwise, false. + + + + Gets or sets the cache duration in days. + + The cache duration in days. + + + + Gets or sets a value indicating whether this is combined. + + true if combined; otherwise, false. + + + + Gets the items. + + The items. + + + + Class used to build initialization script of jQuery plugin. + + + + + Initializes a new instance of the class. + + The id. + The type. + The text writer. + + + + Starts writing this instance. + + + + + + Appends the specified key value pair to the end of this instance. + + The key value pair. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and nullable value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + The default value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + if set to true [value]. + + + + + Appends the specified name and value to the end of this instance. + + The name. + if set to true [value]. + if set to true [default value]. + + + + + Appends the specified name and only the date of the passed . + + The name. + The value. + + + + + Appends the specified name and only the date of the passed . + + The name. + The value. + + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The action. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The values. + + + + + Appends the specified name and value to the end of this instance. + + The name. + The values. + + + + + Appends the specified name and value to the end of this instance. + + The type of the enum. + The name. + The value. + + + + + Appends the specified name and value to the end of this instance. + + The type of the enum. + The name. + The value. + The default value. + + + + + + Completes this instance. + + + + + Defines members that a class must implement in order to provide helper methods for resolving relative path. + + + + + Returns the relative path for the specified virtual path. + + The URL. + + + + + HTMLHelper extension for providing access to . + + + + + Gets the Telerik View Component Factory + + The helper. + The Factory + + + + Gets the Telerik View Component Factory + + The helper. + The Factory + + + + Container of scriptable component. + + + + + Registers the specified component. + + The component. + + + + Provides the factory methods for creating Telerik View Components. + + + + + Creates a + + + + <%= Html.Telerik().StyleSheetRegistrar() + .DefaultGroup(group => group + group.Add("Site.css") + .Add("telerik.common.css") + .Add("telerik.vista.css") + .Compressed(true) + ) + %> + + + + + + Creates a + + + + <%= Html.Telerik().ScriptRegistrar() + %> + + + + + + Creates a + + + + <%= Html.Telerik().Menu() + .Name("Menu") + .Items(items => { /* add items here */ }); + %> + + + + + + Creates a + + + + <%= Html.Telerik().Editor() + .Name("Editor"); + %> + + + + + + Creates a new bound to the specified data item type. + + + The type of the data item + + <%= Html.Telerik().Grid<Order>() + .Name("Grid") + .BindTo(Model) + %> + + + + Do not forget to bind the grid using the method when using this overload. + + + + + Creates a new bound to the specified data source. + + The type of the data item + The data source. + + + <%= Html.Telerik().Grid(Model) + .Name("Grid") + %> + + + + + + Creates a new bound an item in ViewData. + + Type of the data item + The data source view data key. + + + <%= Html.Telerik().Grid<Order>("orders") + .Name("Grid") + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().TabStrip() + .Name("TabStrip") + .Items(items => + { + items.Add().Text("First"); + items.Add().Text("Second"); + }) + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().DatePicker() + .Name("DatePicker") + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().Calendar() + .Name("Calendar") + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().PanelBar() + .Name("PanelBar") + .Items(items => + { + items.Add().Text("First"); + items.Add().Text("Second"); + }) + %> + + + + + + Creates a + + + + <%= Html.Telerik().TreeView() + .Name("TreeView") + .Items(items => { /* add items here */ }); + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().NumericTextBox() + .Name("NumericTextBox") + %> + + + Returns . + + + + + Creates a new . + + + + <%= Html.Telerik().CurrencyTextBox() + .Name("CurrencyTextBox") + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().PercentTextBox() + .Name("PercentTextBox") + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().IntegerTextBox() + .Name("IntegerTextBox") + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().Window() + .Name("Window") + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().DropDownList() + .Name("DropDownList") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().ComboBox() + .Name("ComboBox") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + Creates a new . + + + + <%= Html.Telerik().AutoComplete() + .Name("AutoComplete") + .Items(items => + { + items.Add().Text("First Item"); + items.Add().Text("Second Item"); + }) + %> + + + + + + Creates a new UI component. + + + + + Creates a new . + + + + <%= Html.Telerik().NumericTextBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().NumericTextBoxFor(m=>m.NullableProperty) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().IntegerTextBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().IntegerTextBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().CurrencyTextBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().CurrencyTextBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().PercentTextBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().PercentTextBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().DatePickerFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().DatePickerFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().DropDownListFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().ComboBoxFor(m=>m.Property) %> + + + + + + Creates a new . + + + + <%= Html.Telerik().AutoCompleteFor(m=>m.Property) %> + + + + + + The default web asset merger. + + + + + Initializes a new instance of the class. + + The asset registry. + The URL resolver. + The URL encoder. + + + + Merges the specified assets. + + Type of the content. + The asset handler path. + if set to true [is secure]. + if set to true [can compress]. + The assets. + + + + + Defines members that a class must implement in order to act as wrapper for script, + + + + + Gets the on page load start. + + The on page load start. + + + + Gets the on page load end. + + The on page load end. + + + + Gets the on page unload start. + + The on page unload start. + + + + Gets the on page unload end. + + The on page unload end. + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The style sheet registrar. + + + + Performs an implicit conversion from to . + + The builder. + The result of the conversion. + + + + Returns the internal style sheet registrar. + + + + + + Sets the asset handler path. Path must be a virtual path. + + The value. + + + <%= Html.Telerik().StyleSheetRegistrar() + .AssetHandlerPath("~/asset.axd") + %> + + + + + + Configures the . + + The configure action. + + + <%= Html.Telerik().StyleSheetRegistrar() + .DefaultGroup(group => group + .Add("style1.css") + .Add("style2.css") + .Combined(true) + ) + %> + + + + + + Executes the provided delegate that is used to register the stylesheet files fluently. + + The configure action. + + + + + Renders the + + + + <% Html.Telerik().StyleSheetRegistrar() + .Render(); + %> + + + + + + Manages ASP.NET MVC views style sheet files. + + + + + Used to ensure that the same instance is used for the same HttpContext. + + + + + Initializes a new instance of the class. + + The style sheets. + The view context. + The asset merger. + + + + Writes the stylesheets in the response. + + + + + Writes all stylesheet source. + + The writer. + + + + Gets or sets the asset handler path. Path must be a virtual path. The default value is set to WebAssetHttpHandler.DefaultPath. + + The asset handler path. + + + + Gets or sets the default group. + + The default group. + + + + Gets the stylesheets that will be rendered in the view. + + The style sheets. + + + + Gets or sets the view context. + + The view context. + + + + Gets or sets the asset merger. + + The asset merger. + + + + Class used to resolve relative path for virtual path. + + + + + Returns the relative path for the specified virtual path. + + The URL. + + + + + Wrap the script for the jQuery ready/unload events. + + + + + Gets the on page load start. + + The on page load start. + + + + Gets the on page load end. + + The on page load end. + + + + Gets the on page unload start. + + The on page unload start. + + + + Gets the on page unload end. + + The on page unload end. + + + + Helper class to get currrent and invariant culture. + + + + + Gets the System.Globalization.CultureInfo that represents the current culture used by the Resource Manager to look up culture-specific resources at run time. + + The current. + + + + Gets the System.Globalization.CultureInfo that represents the current UI culture + + The current. + + + + Gets the System.Globalization.CultureInfo that is culture-independent (invariant). + + The invariant. + + + + Defines the fluent interface for configuring the . + + + + + Initializes a new instance of the class. + + The asset item group. + + + + Performs an implicit conversion from to . + + The builder. + The result of the conversion. + + + + Returns the internal group. + + + + + + Sets whether Telerik content delivery network would be used. + + if set to true [value]. + + + + + Sets the content delivery network URL. + + The value. + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group.ContentDeliveryNetworkUrl("http://www.example.com")) + %> + + + + + + Enables or disables the group + + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group.Enabled((bool)ViewData["enabled"])) + %> + + + + + + Sets the version. + + The value. + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group.Version("1.1")) + %> + + + + + + Sets whether the groups will be served as compressed. By default asset groups are not compressed. + + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group.Compress(true)) + %> + + + + + + Sets the caches the duration of this group. + + The value. + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group.CacheDurationInDays(365)) + %> + + + + + + Sets whether the groups items will be served as combined. + + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group.Combined(true)) + %> + + + + + + Sets the defaults path of the containing . + + The path. + + + + + Adds the specified source as . + + The value. + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group.Add("script1.js")) + %> + + + + + + Manages ASP.NET MVC javascript files and statements. + + + + + Used to ensure that the same instance is used for the same HttpContext. + + + + + Initializes a new instance of the class. + + The scripts. + The scriptable components. + The view context. + The asset merger. + The script wrapper. + + + + Registers the scriptable component. + + The component. + + + + Writes the scripts in the response. + + + + + Writes all script source and script statements. + + The writer. + + + + Gets the framework script file names. + + The framework script file names. + + + + Gets or sets a value indicating whether [exclude framework scripts]. + + + true if [exclude framework scripts]; otherwise, false. + + + + + Gets or sets the asset handler path. Path must be a virtual path. The default value is set to . + + The asset handler path. + + + + Gets the default script group. + + The default group. + + + + Gets or sets a value indicating whether [enable globalization]. + + true if [enable globalization]; otherwise, false. + + + + Gets the scripts that will be rendered in the view. + + The scripts. + + + + Gets the on document ready actions. + + The on page load actions. + + + + Gets the on document ready statements that is used in RenderAction. + + The on page load actions. + + + + Gets the on window unload actions. + + The on page unload actions. + + + + Gets the on window unload statements.that is used in RenderAction. + + The on page load actions. + + + + Gets the view context. + + The view context. + + + + Gets the asset merger. + + The asset merger. + + + + Gets the script wrapper that is used to write the script statements. + + The script wrapper. + + + + Defines the fluent interface for configuring the component. + + + + + Initializes a new instance of the class. + + The script registrar. + + + + Performs an implicit conversion from to . + + The builder. + The result of the conversion. + + + + Returns the internal script registrar. + + + + + + Sets the asset handler path. Path must be a virtual path. + + The value. + + + <%= Html.Telerik().ScriptRegistrar() + .AssetHandlerPath("~/asset.axd") + %> + + + + + + Configures the . + + The configure action. + + + <%= Html.Telerik().ScriptRegistrar() + .DefaultGroup(group => group + .Add("script1.js") + .Add("script2.js") + .Combined(true) + ) + %> + + + + + + Enables globalization support. + + if set to true [enable]. + + + <%= Html.Telerik().ScriptRegistrar() + .Globalization(true) + %> + + + + + + Includes the jQuery script files. By default jQuery JavaScript is included. + + + Telerik Extensions for ASP.NET MVC require jQuery so make sure you manually include the JavaScrip file + if you disable the automatic including. + + if set to true [enable]. + + + <%= Html.Telerik().ScriptRegistrar() + .jQuery(false) + %> + + + + + + Executes the provided delegate that is used to register the script files fluently in different groups. + + The configure action. + + + + + Defines the inline handler executed when the DOM document is ready (using the $(document).ready jQuery event) + + The action defining the inline handler + + + <% Html.Telerik().ScriptRegistrar() + .OnDocumentReady(() => + { + %> + function() { + alert("Document is ready"); + } + <% + }) + .Render(); + %> + + + + + + Appends the specified statement in $(document).ready jQuery event. This method should be + used in Html.RenderAction(). + + The statements. + + + + + Defines the inline handler executed when the DOM window object is unloaded. + + The action defining the inline handler + + + <% Html.Telerik().ScriptRegistrar() + .OnWindowUnload(() => + { + %> + function() { + // event handler code + } + <% + }) + .Render(); + %> + + + + + + Appends the specified statement window unload event. This method should be + used in Html.RenderAction(). + + The statements. + + + + + Renders the + + + + <% Html.Telerik().ScriptRegistrar() + .Render(); + %> + + + + + + Web asset types. + + + + + None, used for internal purpose. + + + + + Stylesheet + + + + + Javascript + + + + diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index c36a9c25d..f34ba84e3 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -24,6 +24,7 @@ DEBUG;TRACE prompt 4 + x86 pdbonly @@ -47,6 +48,7 @@ ..\NzbDrone.Core\Libraries\System.Data.SQLite.dll + True @@ -69,6 +71,10 @@ + + False + Libraries\Telerik.Web.Mvc.dll + @@ -78,22 +84,125 @@ Global.asax + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer @@ -104,7 +213,6 @@ Web.config - @@ -124,7 +232,6 @@ - diff --git a/NzbDrone.Web/Scripts/2010.2.825/jquery-1.4.2.min.js b/NzbDrone.Web/Scripts/2010.2.825/jquery-1.4.2.min.js new file mode 100644 index 000000000..7c2430802 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/jquery-1.4.2.min.js @@ -0,0 +1,154 @@ +/*! + * jQuery JavaScript Library v1.4.2 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 + */ +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/NzbDrone.Web/Scripts/2010.2.825/jquery.validate.min.js b/NzbDrone.Web/Scripts/2010.2.825/jquery.validate.min.js new file mode 100644 index 000000000..6264866fc --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/jquery.validate.min.js @@ -0,0 +1,16 @@ +/* + * jQuery validation plug-in 1.7 + * + * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ + * http://docs.jquery.com/Plugins/Validation + * + * Copyright (c) 2006 - 2008 Jörn Zaefferer + * + * $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&¶ms.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);else if(element.parentNode.name in this.submitted)this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id ++", check the '"+rule.method+"' method",e);throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;iWarning: No message defined for "+element.name+"");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages;}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.autocomplete.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.autocomplete.min.js new file mode 100644 index 000000000..2c86ad184 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.autocomplete.min.js @@ -0,0 +1 @@ +(function(a){var b=a.telerik;b.autocomplete=function(c,d){a.extend(this,d);var e=a(c);this.$text=e;this.element=c;this.$element=e;this.trigger=new b.list.trigger(this);this.trigger.change=function(){var j=this.component.text();var i=this.component.previousValue;if(i==undefined||j!=i){b.trigger(this.component.element,"valueChange",{value:j})}this.component.previousValue=j};this.loader=new b.list.loader(this);this.loader.showBusy=function(){this.busyTimeout=setTimeout(a.proxy(function(){this.component.$element.addClass("t-loading")},this),100)};this.loader.hideBusy=function(){clearTimeout(this.busyTimeout);this.component.$element.removeClass("t-loading")};this.filtering=new b.list.filtering(this);this.filtering.autoFill=function(r,n){if(r.autoFill&&(r.lastKeyCode!=8&&r.lastKeyCode!=46)){var u=r.$text[0];var i=u.value;var s=r.separator;var o=b.caretPos(u);var k=s?b.lastIndexOf(i.substring(0,o),s):-1;var p=k!=-1?k+s.length:0;var l=i.substring(p,o);var t=n.toLowerCase().indexOf(l.toLowerCase());if(t!=-1){var q=n.substring(t+l.length);var j=f(u,s);var m=i.split(s);m[j]=l+q;u.value=m.join(s)+(r.multiple&&j!=0&&j==m.length-1?s:"");b.list.selection(u,o,o+q.length)}}};this.filtering.multiple=a.proxy(function(i){if(this.multiple){i=i.split(this.separator);i=i[f(this.$text[0],this.separator)]}return i},this);this.dropDown=new b.dropDown({outerHeight:e.outerHeight(),outerWidth:e.outerWidth(),zIndex:b.list.getZIndex(e),attr:this.dropDownAttr,effects:this.effects,onOpen:a.proxy(function(){var j=this.dropDown;var i=e.offset();j.position(i.top,i.left);if(!j.outerHeight){j.outerHeight=e.outerHeight()}if(!j.outerWidth){j.outerWidth=e.outerWidth();j.$element.css("width",j.outerWidth-2)}return true},this),onClick:a.proxy(function(i){this.select(i.item);this.trigger.change();this.trigger.close()},this)});this.fill=function(j){function i(r){var q=r.highlightFirst?n.$items.first():null;if(q){q.addClass("t-state-selected")}}var o=this.loader;var n=this.dropDown;var k=this.minChars;var m=this.text();var p=m.length;if(!n.$items&&!o.ajaxError){if(o.isAjax()&&p>=k){var l={};l[this.queryString.text]=m;o.ajaxRequest(function(q){this.data=q;n.dataBind(q);i(this);b.trigger(this.element,"dataBound");if(j){j()}},{data:l})}else{n.dataBind(this.data);i(this);if(j){j()}}}};this.text=function(i){return this.$text.val(i)};this.value=function(){return this.text.apply(this,arguments)};this.select=function(q){var p=this.highlight(q);if(p==-1){return p}var j=this.filteredDataIndexes;var l=(j&&j.length)>0?j[p]:p;var q=this.data[l];var n=q.Text?q.Text:q;var i=n;if(this.multiple){var k=this.$element;var o=this.separator;var m=f(k[0],o);i=k.val().split(o);i[m]=n;i=i.join(o)+(m==i.length-1?o:"")}this.text(i)};this.previousValue=this.value();b.list.common.call(this);b.list.filters.call(this);b.bind(this,{dataBinding:this.onDataBinding,dataBound:this.onDataBound,error:this.onError,open:this.onOpen,close:this.onClose,valueChange:this.onChange,load:this.onLoad});e.bind({focus:a.proxy(function(i){i.stopPropagation()},this),keydown:a.proxy(h,this),keypress:a.proxy(function(j){var i=j.keyCode||j.charCode;if(i==0||a.inArray(i,b.list.keycodes)!=-1){return true}g(this)},this)});a(document).bind("mousedown",a.proxy(function(j){var i=this.dropDown.$element.parent();if((i.length>0)&&!a.contains(c,j.target)&&!a.contains(i[0],j.target)){this.trigger.change();this.trigger.close()}},this));function f(i,j){return i.value.substring(0,b.caretPos(i)).split(j).length-1}function g(i){clearTimeout(i.timeout);i.timeout=setTimeout(function(){i.filtering.filter(i)},i.delay)}function h(r){var m=this.trigger;var j=this.dropDown;var n=r.keyCode||r.which;this.lastKeyCode=n;if(!r.shiftKey&&n>36&&n<41&&n!=37&&n!=39){r.preventDefault();if(j.isOpened()){if(!j.$items){this.fill()}var k=j.$items;var o=k.filter(".t-state-selected:first");var i=[];if(n==38){var s=o.prev();i=s.length?s:k.last()}else{if(n==40){var p=o.next();i=p.length?p:k.first()}}if(i.length){var t=i[0];this.highlight(t);j.scrollTo(t);this.filtering.autoFill(this,i.text())}}}if(n==8||n==46){var l=this.$element;if(l.val()!=""){g(this)}setTimeout(a.proxy(function(){if(l.val()==""){m.close()}},this),0)}if(n==13){if(j.$items.length){var q=j.$items.filter(".t-state-selected:first");if(j.isOpened()){r.preventDefault()}if(q.length>0){this.select(q[0]);m.change();m.close();b.list.moveToEnd(this.element)}}}if(n==27||n==9){m.change();m.close()}}};a.fn.tAutoComplete=function(c){return b.create(this,{name:"tAutoComplete",init:function(d,e){return new b.autocomplete(d,e)},options:c})};a.fn.tAutoComplete.defaults={effects:b.fx.slide.defaults(),filter:1,delay:200,minChars:1,cache:true,autoFill:false,highlightFirst:false,queryString:{text:"text"},multiple:false,separator:", "}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.calendar.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.calendar.min.js new file mode 100644 index 000000000..2f9f37d13 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.calendar.min.js @@ -0,0 +1 @@ +(function(c){var a=c.telerik;var b=/d{1,4}|M{1,4}|yy(?:yy)?|([Hhmstf])\1*|"[^"]*"|'[^']*'/g;c.extend(a,{calendar:function(e,f){this.element=e;c.extend(this,f);this.currentView=a.calendar.views[0];var d=new a.datetime();this.viewedMonth=a.datetime.firstDayOfMonth(this.selectedDate||(a.calendar.isInRange(d,this.minDate,this.maxDate)?d:this.minDate));c(".t-nav-next:not(.t-state-disabled)",e).live("click",c.proxy(this.navigateToFuture,this));c(".t-nav-prev:not(.t-state-disabled)",e).live("click",c.proxy(this.navigateToPast,this));c(".t-nav-fast:not(.t-state-disabled)",e).live("click",c.proxy(this.navigateUp,this));c(".t-link.t-state-disabled",e).live("click",a.preventDefault);c("td:not(.t-state-disabled):has(.t-link)",e).live("mouseenter",a.hover).live("mouseleave",a.leave).live("click",c.proxy(this.navigateDown,this));a.bind(this,{change:this.onChange,load:this.onLoad})}});c.extend(a.cultureInfo,{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbrDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],abbrMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longTime:"h:mm:ss tt",longDate:"dddd, MMMM dd, yyyy",shortDate:"M/d/yyyy",shortTime:"h:mm tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",generalDateShortTime:"M/d/yyyy h:mm tt",generalDateTime:"M/d/yyyy h:mm:ss tt",sortableDateTime:"yyyy'-'MM'-'ddTHH':'mm':'ss",universalSortableDateTime:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",monthYear:"MMMM, yyyy",monthDay:"MMMM dd",today:"today",tomorrow:"tomorrow",yesterday:"yesterday",next:"next",last:"last",year:"year",month:"month",week:"week",day:"day",am:"AM",pm:"PM",dateSeparator:"/",timeSeparator:":"});a.calendar.prototype={stopAnimation:false,updateSelection:function(){var h=new a.datetime();var f=a.datetime.firstDayOfMonth(this.viewedMonth);var e=new a.datetime(f.value).date(32).date(0);if(this.selectedDate===null||!a.calendar.isInRange(this.selectedDate,f,e)){this.goToView(0,a.datetime.firstDayOfMonth(this.selectedDate||(a.calendar.isInRange(h,this.minDate,this.maxDate)?h:this.minDate)))}var d=this;var g=c(".t-content td:not(.t-other-month)",this.element).removeClass("t-state-selected");if(this.selectedDate!==null){g.filter(function(){return(parseInt(c(this).text(),10)==d.selectedDate.date())}).addClass("t-state-selected")}},value:function(){if(arguments.length==0){return this.selectedDate===null?null:this.selectedDate.toDate()}if(arguments.length==1){this.selectedDate=arguments[0]===null?null:arguments[0].value?arguments[0]:new a.datetime(arguments[0])}else{if(arguments.length>1){this.selectedDate=new a.datetime(arguments[0],arguments[1],arguments[2])}}this.updateSelection();return this},overlay:function(d){if(!d){return c(".t-overlay",this.element).remove()}c("
").addClass("t-overlay").css({opacity:0,width:this.element.offsetWidth,height:this.element.offsetHeight,position:"absolute",top:0,left:0,zIndex:3,backgroundColor:"#fff"}).appendTo(this.element)},goToView:function(d,e){if(d<0||a.calendar.views.length<=d){return}if(typeof e!="undefined"){this.viewedMonth=a.datetime.firstDayOfMonth(e)}this.currentView=a.calendar.views[d];c(".t-nav-prev",this.element).toggleClass("t-state-disabled",this.currentView.compare(e,this.minDate,false)<=0);c(".t-nav-next",this.element).toggleClass("t-state-disabled",this.currentView.compare(e,this.maxDate,true)>=0);c(".t-nav-fast",this.element).html(this.currentView.title(this.viewedMonth)).toggleClass("t-state-disabled",d==a.calendar.views.length-1);c(".t-content",this.element).html(this.currentView.body(this.viewedMonth,this.minDate,this.maxDate,this.selectedDate,this.urlFormat,this.dates)).toggleClass("t-meta-view",d==1||d==2);return this},navigateVertically:function(e,g,h,p){this.viewedMonth=a.datetime.firstDayOfMonth(g);this.currentView=a.calendar.views[e];this.overlay(true);var o=c(".t-content",this.element);var f=o.outerWidth();var m=o.outerHeight();var i=o.css("font-size");var q=o.css("line-height");if(q==="normal"){q=parseInt(i)*1.5}o.find("td").removeClass("t-state-hover");c(".t-nav-fast",this.element).html(this.currentView.title(g)).toggleClass("t-state-disabled",e==a.calendar.views.length-1);c(".t-nav-prev",this.element).toggleClass("t-state-disabled",this.currentView.compare(this.viewedMonth,this.minDate,false)<=0);c(".t-nav-next",this.element).toggleClass("t-state-disabled",this.currentView.compare(this.viewedMonth,this.maxDate,true)>=0);var r=c('
').html(this.currentView.body(g,this.minDate,this.maxDate,this.selectedDate,this.urlFormat,this.dates)).toggleClass("t-meta-view",e==1||e==2);var d=this;var l={fontSize:i,lineHeight:q,top:0,left:0,width:f,height:m,opacity:1};var k;if(h){k=a.fx._wrap(o).css({overflow:"hidden",position:"relative"});r.wrap(c("
").addClass("t-animation-container").css(c.extend({position:"absolute",zIndex:1,fontSize:1,lineHeight:1,width:p.outerWidth(),height:p.outerHeight(),opacity:0},p.position()))).parent().insertAfter(o);if(!this.stopAnimation){r.parent().animate({fontSize:i,lineHeight:q,top:0,left:0,width:f,height:m,opacity:1},"normal",function(){r.appendTo(d.element);k.remove();d.overlay(false)})}else{o.remove();r.appendTo(d.element);k.remove();d.overlay(false)}}else{r.insertBefore(o);k=a.fx._wrap(r).css({overflow:"hidden",position:"relative"});var j;if(e!=0){j=a.calendar.views[e].verticalDate(this.viewedMonth)}var n={top:(Math.floor(j/4)*m)/3,left:((j%4)*f)/4};o.wrap(c("
").addClass("t-animation-container").css(c.extend({position:"absolute"},l))).parent().insertAfter(r);if(!this.stopAnimation){o.parent().animate(c.extend({fontSize:1,lineHeight:1,width:48,height:54,opacity:0},n),"normal",function(){r.appendTo(d.element);k.remove();d.overlay(false)})}else{o.remove();r.appendTo(d.element);k.remove();d.overlay(false)}}a.trigger(this.element,"navigate",{direction:h})},navigateHorizontally:function(d,f,h){this.viewedMonth=a.datetime.firstDayOfMonth(a.calendar.fitDateToRange(f,this.minDate,this.maxDate));this.currentView=a.calendar.views[d];c(".t-nav-fast",this.element).html(this.currentView.title(f)).toggleClass("t-state-disabled",d==a.calendar.views.length-1);c(".t-nav-prev",this.element).toggleClass("t-state-disabled",this.currentView.compare(this.viewedMonth,this.minDate,false)<=0);c(".t-nav-next",this.element).toggleClass("t-state-disabled",this.currentView.compare(this.viewedMonth,this.maxDate,true)>=0);this.overlay(true);var g=c('
').html(this.currentView.body(f,this.minDate,this.maxDate,this.selectedDate,this.urlFormat,this.dates)).toggleClass("t-meta-view",d==1||d==2);var e=c(".t-content",this.element);var k=e.outerWidth();e.add(g).css({width:k,"float":"left"});var j=a.fx._wrap(e).css({position:"relative",width:k*2,"float":"left",left:(h?0:-200)});g[h?"insertAfter":"insertBefore"](e);var i=this;if(!this.stopAnimation){j.animate({left:(h?-200:0)},"normal",function(){g.appendTo(i.element);j.remove();i.overlay(false)})}else{e.remove();g.appendTo(i.element);j.remove();i.overlay(false)}a.trigger(this.element,"navigate",{direction:h})},navigateUp:function(f){if(f){f.preventDefault()}var d=this.currentView.index;this.navigateVertically(d+1,this.viewedMonth,false)},navigateDown:function(m,k,d){var g=c(c(m.target).hasClass("t-input")?k:m.target);var n=g.text();var l=d||this.currentView.index;var f=g.attr("href");if(f&&(f.charAt(f.length-1)=="#")){m.preventDefault()}if(l==0){var j=parseInt(n,10);var i=this.viewedMonth.month();if(g.parent().hasClass("t-other-month")){i+=(j<15?1:-1)}var h=new a.datetime(this.viewedMonth.year(),i,j);if(!this.selectedDate||(this.selectedDate.value>h.value||h.value>this.selectedDate.value)){if(a.trigger(this.element,"change",{previousDate:this.selectedDate===null?null:this.selectedDate.toDate(),date:h.toDate()})){return this}this.selectedDate=h}this.updateSelection()}else{if(l!=0){a.calendar.views[l].verticalDate(this.viewedMonth,n)}this.viewedMonth=a.calendar.fitDateToRange(this.viewedMonth,this.minDate,this.maxDate);this.navigateVertically(l-1,this.viewedMonth,true,g.add(g.parent()).filter("td"))}},navigateToPast:function(f){if(f){f.preventDefault()}var d=this.currentView.index;if(d==0){this.viewedMonth.date(1).date(-1)}else{this.viewedMonth.addYear(-Math.pow(10,d-1))}this.navigateHorizontally(d,this.viewedMonth,false)},navigateToFuture:function(f){if(f){f.preventDefault()}var d=this.currentView.index;if(d==0){this.viewedMonth.date(32).date(1)}else{this.viewedMonth.addYear(Math.pow(10,d-1))}this.navigateHorizontally(d,this.viewedMonth,true)}};c.fn.tCalendar=function(d){return a.create(this,{name:"tCalendar",init:function(e,f){return new a.calendar(e,f)},options:d})};c.fn.tCalendar.defaults={selectedDate:null,minDate:new a.datetime(1899,11,31),maxDate:new a.datetime(2100,0,1)};c.extend(a.calendar,{views:[{index:0,title:function(d){return new a.stringBuilder().cat(a.cultureInfo.months[d.month()]).cat(" ").cat(d.year()).string()},body:function(f,n,k,j,h,m){var s=(new a.stringBuilder()).cat('');for(var g=0;g<7;g++){s.cat('').cat(a.cultureInfo.days[g].charAt(0)).cat("")}s.cat("");var o=a.datetime.firstVisibleDay(f);var d=f.month();var q=j===null?false:f.year()==j.year();var r;for(var p=0;p<6;p++){s.cat("");for(var e=0;e<7;e++){r=o.month()!=d?"t-other-month":(q&&o.month()==j.month()&&o.date()==j.date())?" t-state-selected":"";s.cat("");if(a.calendar.isInRange(o,n,k)){s.cat('').cat(o.date()).cat("")}else{s.cat(" ")}s.cat("");a.datetime.modify(o,a.datetime.msPerDay)}s.cat("")}s.cat("");return s.string()},compare:function(e,d){var g;var j=e.month();var f=e.year();var i=d.month();var h=d.year();if(f>h){g=1}else{if(fi?1:-1}}return g},firstLastDay:function(f,d,e){return d?a.datetime.firstDayOfMonth(f):new a.datetime(f.year(),f.month()+1,0)},navCheck:function(e,d,f){return f?new a.datetime(d.year(),d.month()+1,d.date()).value-e.value<=0:e.value=f.year()){h>f.month()?g.push(" "):g.push(a.cultureInfo.abbrMonths[h])}else{g.push(a.cultureInfo.abbrMonths[h])}}}return g})},compare:function(d,e){return d.year()>e.year()?1:d.year()=g&&j+l<=k?j+l:" ")}return h})},compare:function(e,d,g){var h=e.year();var f=(h-h%10);var i=(h-h%10+9);return a.calendar.check(f,i,d,g)},verticalDate:function(d,e){if(!e){return d.year()%10+1}d.year(e)},firstLastDay:function(d,e){return new a.datetime(d.year()-d.year()%10+(e?0:9),0,1)},navCheck:function(f,d,g){var e=this.compare(d,f,g);return g?e==-1:e==1}},{index:3,title:function(e){var d=e.year()-e.year()%100;return d+"-"+(d+99)},body:function(e,d,f){return a.calendar.metaView(false,e,function(){var j=e.year()-e.year()%100;var g=[];for(var k=-1;k<11;k++){var h=j+k*10;if((h+10)>=d.year()&&h<=f.year()){g.push(h+"-
"+(h+9)+" ")}else{g.push(" 
 ")}}return g})},compare:function(e,d,f){var g=e.year();var i=(g-g%100);var h=(g-g%100+99);return a.calendar.check(i,h,d,f)},verticalDate:function(d,e){if(!e){return Math.ceil(d.year()/10)%10+1}d.year(e.substring(0,e.indexOf("-")))},firstLastDay:function(d,e){return e?new a.datetime(d.year()-(d.year()%100),0,1):new a.datetime(d.year()-(d.year()%100)+99,0,1)},navCheck:function(f,d,g){var e=this.compare(d,f,g);return g?e==-1:e==1}}],check:function(g,h,d,e){var f=function(i){return id.year()?1:0};return e?f(h):f(g)},pad:function(d){if(d<10){return"0"+d}return d},standardFormat:function(d){var e=a.cultureInfo;var f={d:e.shortDate,D:e.longDate,F:e.fullDateTime,g:e.generalDateShortTime,G:e.generalDateTime,m:e.monthDay,M:e.monthDay,s:e.sortableDateTime,t:e.shortTime,T:e.longTime,u:e.universalSortableDateTime,y:e.monthYear,Y:e.monthYear};return f[d]},formatDate:function(u,e){var o=a.cultureInfo;var r=u.getDate();var g=u.getDay();var q=u.getMonth();var i=u.getFullYear();var n=u.getHours();var k=u.getMinutes();var j=u.getSeconds();var t=u.getMilliseconds();var p=a.calendar.pad;var v={d:r,dd:p(r),ddd:o.abbrDays[g],dddd:o.days[g],M:q+1,MM:p(q+1),MMM:o.abbrMonths[q],MMMM:o.months[q],yy:p(i%100),yyyy:i,h:n%12||12,hh:p(n%12||12),H:n,HH:p(n),m:k,mm:p(k),s:j,ss:p(j),f:Math.floor(t/100),ff:Math.floor(t/10),fff:t,tt:n<12?o.am:o.pm};e=e||"G";e=a.calendar.standardFormat(e)?a.calendar.standardFormat(e):e;return e.replace(b,function(d){return d in v?v[d]:d.slice(1,d.length-1)})},html:function(g,e,d,h,i,f){g=g||new a.datetime();d=d||c.fn.tCalendar.defaults.minDate;h=h||c.fn.tCalendar.defaults.maxDate;return new a.stringBuilder().cat('
').cat('").cat('').cat(a.calendar.views[0].body(g,d,h,e,i,f)).cat("
").string()},metaView:function(h,k,e){var f=new a.stringBuilder();var j=e();f.cat("");for(var d=0,g=j.length;d",d>0&&d%4==0).cat("");if(j[d]!==" "&&j[d]!==" 
 "){f.cat('').cat(j[d]).cat("")}else{f.cat(j[d])}f.cat("")}f.cat("");return f.string()},isInRange:function(f,d,e){if(!f){return false}return d.value-f.value<=0&&e.value-f.value>=0},fitDateToRange:function(f,d,e){if(f.valuee.value){f=new a.datetime(e.value)}return f},isInCollection:function(g,d){var e=d[g.year()];if(e){var f=e[g.month()];if(f&&c.inArray(g.date(),f)!=-1){return true}}return false},findTarget:function(i,l,k,g){var d=function(m,n){return c.grep(m,function(o){return c(o).children().eq(0).text().indexOf(n)>-1})[0]};var e=g?"last":"first";var j=c(".t-content:"+e+" td:has(> .t-link)",k).removeClass("t-state-focus");var f;if(l==0){f=c(d(j.filter(":not(.t-other-month)"),i.date()))}else{if(l==1){f=c(d(j,a.cultureInfo.abbrMonths[i.month()]))}else{if(l==2||l==3){var h=i.year();f=c(d(j,l==2?h:h-(h%10)));if(f.length==0&&l==3){f=c(d(j,h-(h%10)+99))}}}}return f},focusDate:function(g,d,f,e){a.calendar.findTarget(g,d,f,e).addClass("t-state-focus")},formatUrl:function(d,e){return d.replace("{0}",a.calendar.formatDate(e.toDate(),a.cultureInfo.shortDate))}});c.extend(a.formatters,{date:a.calendar.formatDate})})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.combobox.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.combobox.min.js new file mode 100644 index 000000000..c65304694 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.combobox.min.js @@ -0,0 +1 @@ +(function(a){var b=a.telerik;b.combobox=function(c,d){a.extend(this,d);var e=a(c);this.element=c;this.$element=e;this.loader=new b.list.loader(this);this.trigger=new b.list.trigger(this);this.$text=e.find("> .t-dropdown-wrap > .t-input").attr("autocomplete","off");this.filtering=new b.list.filtering(this);this.filtering.autoFill=function(i,j){if(i.autoFill&&(i.lastKeyCode!=8&&i.lastKeyCode!=46)){var k=i.$text[0];var o=b.caretPos(k);var n=k.value.substring(0,o);var m=j.toLowerCase().indexOf(n.toLowerCase());if(m!=-1){var l=j.substring(m+n.length);k.value=n+l;b.list.selection(k,o,o+l.length)}}};this.dropDown=new b.dropDown({outerHeight:e.outerHeight(),outerWidth:e.outerWidth(),zIndex:b.list.getZIndex(e),attr:this.dropDownAttr,effects:this.effects,onOpen:a.proxy(function(){var j=this.data;var i=this.dropDown;var m=e.offset();i.position(m.top,m.left);if(!i.outerHeight){i.outerHeight=e.outerHeight()}if(!i.outerWidth){i.outerWidth=e.outerWidth();i.$element.css("width",i.outerWidth-2)}if(j.length==0){return}var k=this.$text.val();var l=this.selectedIndex;if(l!=-1&&this.isFiltered){if(k==j[l].Text){this.filteredDataIndexes=[];i.onItemCreate=null;i.dataBind(this.data);this.select(i.$items[l])}else{this.filters[this.filter](this,this.data,k)}this.isFiltered=false}return true},this),onClick:a.proxy(function(i){this.select(i.item);this.trigger.change(this);this.trigger.close()},this)});this.fill=function(j){function n(q){var r=i.$items;var t=q.index;var s=r.filter(".t-state-selected");var u=s.length;var v=t!=-1&&t0?s[u-1]:null;if(v){q.select(v)}else{q.selectedIndex=-1;if(q.highlightFirst){q.highlight(r[0])}}}var l=this.loader;var i=this.dropDown;var o=this.minChars;var m=this.text();var k=m.length;if(!i.$items&&!l.ajaxError){if(l.isAjax()&&k>=o){var p={};p[this.queryString.text]=m;l.ajaxRequest(function(q){this.data=q;i.dataBind(q);n(this);b.trigger(this.element,"dataBound");this.trigger.change();if(j){j()}},{data:p})}else{i.dataBind(this.data);n(this);if(j){j()}}}};this.reload=function(){this.dropDown.$items=null;this.fill()};this.select=function(j){var i=this.highlight(j);if(i==-1){return i}var k=this.filteredDataIndexes;this.selectedIndex=(k&&k.length)>0?k[i]:i;b.list.updateTextAndValue(this,a(this.dropDown.$items[i]).text(),this.data[this.selectedIndex].Value)};this.text=function(i){return this.$text.val(i)};this.value=function(){if(arguments.length){var j=arguments[0];var i=this.select(function(k){return j==k.Value});if(i==-1){this.$input.val(j);this.text(j)}this.previousValue=this.$input.val()}else{return this.$input.val()}};b.list.common.call(this);b.list.filters.call(this);b.list.initialize.call(this);this.$text.bind({change:a.proxy(function(i){i.stopPropagation()},this),keydown:a.proxy(g,this),keypress:a.proxy(h,this),focus:a.proxy(function(l){var j=this.trigger;var i=this.dropDown;if(!i.$items){this.fill(j.open)}else{j.open()}var k=this.$text;b.list.selection(k[0],0,k.val().length)},this)});e.find("> .t-dropdown-wrap > .t-select").click(a.proxy(function(i){this.loader.ajaxError=false;if(!this.dropDown.isOpened()){this.$text[0].focus()}else{this.trigger.close()}},this));function f(i){clearTimeout(i.timeout);i.timeout=setTimeout(function(){i.filtering.filter(i)},i.delay)}function g(q){var l=this.trigger;var j=this.dropDown;var n=q.keyCode||q.which;this.lastKeyCode=n;if(q.altKey&&n==38){l.close();return}if(q.altKey&&n==40){l.open();return}if(!q.shiftKey&&(n==38||n==40)){q.preventDefault();if(!j.$items){this.fill()}var k=j.$items;var o=k.filter(".t-state-selected:first");var i=o.length==0||k.length==1?k.first():(n==38)?o.prev():(n==40)?o.next():[];if(i.length){var r=i[0];this.select(r);j.scrollTo(r);if(!j.isOpened()){l.change()}}}if(n==8||n==46){var m=this.$text;if(m.val()!=""){f(this)}setTimeout(a.proxy(function(){if(m.val()==""){this.selectedIndex=-1;this.$input.val("")}else{this.$input.val(this.$text.val())}},this),0)}if(n==13){if(j.isOpened()){q.preventDefault()}var p=j.$items.filter(".t-state-selected:first");if(p.length>0){this.select(p[0])}else{this.$input.val(this.$text.val())}l.change();l.close();b.list.moveToEnd(this.$text[0])}if(n==27||n==9){l.change();l.close();if(n==27){this.$text.blur()}}}function h(j){var i=j.keyCode||j.charCode;if(i==0||a.inArray(i,b.list.keycodes)!=-1){return true}this.$input.val(this.$text.val()+String.fromCharCode(i));f(this)}};a.fn.tComboBox=function(c){return b.create(this,{name:"tComboBox",init:function(d,e){return new b.combobox(d,e)},options:c})};a.fn.tComboBox.defaults={effects:b.fx.slide.defaults(),index:-1,autoFill:true,highlightFirst:true,filter:0,delay:200,minChars:0,cache:true,queryString:{text:"text"}}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.common.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.common.min.js new file mode 100644 index 000000000..eba12900c --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.common.min.js @@ -0,0 +1 @@ +(function(d){try{if(document.execCommand){document.execCommand("BackgroundImageCache",false,true)}}catch(c){}var b=d.telerik={create:function(e,f){var h=f.name;var g=d.extend({},d.fn[h].defaults,f.options);return e.each(function(){var i=d(this);g=d.meta?d.extend({},g,i.data()):g;if(!i.data(h)){var j=f.init(this,g);i.data(h,j);b.trigger(this,"load");if(f.success){f.success(j)}}})},toJson:function(e){var f=[];for(var h in e){var g=e[h];if(typeof g!="object"){f.push('"'+h+'":"'+g+'"')}else{f.push('"'+h+'":'+this.toJson(g))}}return"{"+f.join(",")+"}"},delegate:function(f,e){return function(g){e.apply(f,[g,this])}},stop:function(e,f){return function(g){g.stopPropagation();e.apply(f||this,arguments)}},stopAll:function(e,f){return function(g){g.preventDefault();g.stopPropagation();e.apply(f||this,arguments)}},bind:function(e,f){var g=d(e.element);d.each(f,function(h){if(d.isFunction(this)){g.bind(h,this)}})},preventDefault:function(f){f.preventDefault()},hover:function(){d(this).addClass("t-state-hover")},leave:function(){d(this).removeClass("t-state-hover")},buttonHover:function(){d(this).addClass("t-button-hover")},buttonLeave:function(){d(this).removeClass("t-button-hover")},stringBuilder:function(){this.buffer=[]},ajaxError:function(h,g,e,i){var f=this.trigger(h,g,{XMLHttpRequest:e,textStatus:i});if(!f){if(i=="error"&&e.status!="0"){alert("Error! The requested URL returned "+e.status+" - "+e.statusText)}if(i=="timeout"){alert("Error! Server timeout.")}}},trigger:function(g,f,h){h=d.extend(h||{},new d.Event(f));h.stopPropagation();d(g).trigger(h);return h.isDefaultPrevented()},getType:function(e){if(e instanceof Date){return"date"}if(!isNaN(e)){return"number"}return"object"},formatString:function(){var j=arguments[0];for(var e=0,f=arguments.length-1;e-1;h--){if(e.substr(h,g)==f){return h}}return -1},caretPos:function(e){var f=-1;if(document.selection){f=Math.abs(e.document.selection.createRange().moveStart("character",-e.value.length))}else{if(e.selectionStart!==undefined){f=e.selectionStart}}return f},formatters:{},fx:{},cultureInfo:{}};b.datetime=function(){if(arguments.length==0){this.value=new Date()}else{if(arguments.length==1){this.value=new Date(arguments[0])}else{if(arguments.length==3){this.value=new Date(arguments[0],arguments[1],arguments[2])}else{if(arguments.length==6){this.value=new Date(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}else{this.value=new Date(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}}}return this};d.extend(b.datetime,{msPerMinute:60000,msPerDay:86400000,add:function(i,f){var g=i.timeOffset();var h=new b.datetime(i.time()+f);var e=h.timeOffset()-g;return new b.datetime(h.time()+e*b.datetime.msPerMinute)},subtract:function(h,g){g=new b.datetime(g).toDate();var e=h.time()-g;var f=h.timeOffset()-g.timeOffset();return e-(f*b.datetime.msPerMinute)},firstDayOfMonth:function(e){return new b.datetime(0).hours(0).minutes(0).year(e.year(),e.month(),1)},firstVisibleDay:function(e){var f=new b.datetime(e.year(),e.month(),0);while(f.day()!=0){b.datetime.modify(f,-1*b.datetime.msPerDay)}return f},modify:function(i,e){var g=i.timeOffset();var f=new b.datetime(i.time()+e);var h=f.timeOffset()-g;i.time(f.time()+h*b.datetime.msPerMinute)}});b.datetime.prototype={year:function(){if(arguments.length==0){return this.value.getFullYear()}else{if(arguments.length==1){this.value.setFullYear(arguments[0])}else{this.value.setFullYear(arguments[0],arguments[1],arguments[2])}}return this},timeOffset:function(){return this.value.getTimezoneOffset()},day:function(){return this.value.getDay()},toDate:function(){return this.value},addMonth:function(e){this.month(this.month()+e)},addYear:function(e){this.year(this.year()+e)}};d.each(["Month","Date","Hours","Minutes","Seconds","Milliseconds","Time"],function(e,f){b.datetime.prototype[f.toLowerCase()]=function(){if(arguments.length==1){this.value["set"+f](arguments[0])}else{return this.value["get"+f]()}return this}});b.stringBuilder.prototype={cat:function(e){this.buffer.push(e);return this},rep:function(f,e){for(var g=0;g").addClass("t-animation-container").css({width:e.outerWidth(),height:e.outerHeight()}))}return e.parent()},play:function(j,k,g,e){var m=a(j,k,e);if(m===null){return}k.stop(false,true);for(var f=0,l=j.list.length;f=0;f--){var h=k.data("effect-"+f)||new b.fx[j.list[f].name](k);h.rewind(d.extend(j.list[f],{openDuration:j.openDuration,closeDuration:j.closeDuration},g),l);k.data("effect-"+f,null)}}});b.fx.toggle=function(e){this.element=e.stop(false,true)};b.fx.toggle.prototype={play:function(e,f){this.element.show();if(f){f()}},rewind:function(e,f){this.element.hide();if(f){f()}}};b.fx.toggle.defaults=function(){return{list:[{name:"toggle"}]}};b.fx.slide=function(e){this.element=e;this.animationContainer=b.fx._wrap(e)};b.fx.slide.prototype={play:function(f,j){var e=this.animationContainer;this.element.css("display","block").stop();e.css({display:"block",overflow:"hidden"});var g=this.element.outerWidth();var l=this.element.outerHeight();var k=f.direction=="bottom"?"marginTop":"marginLeft";var h=f.direction=="bottom"?-l:-g;e.css({width:g,height:l});var i={};i[k]=0;this.element.css("width",this.element.width()).each(function(){this.style.cssText=this.style.cssText}).css(k,h).animate(i,{queue:false,duration:f.openDuration,easing:"linear",complete:function(){e.css("overflow","");if(j){j()}}})},rewind:function(g,f){var h=this.animationContainer;this.element.stop();h.css({overflow:"hidden"});var e;switch(g.direction){case"bottom":e={marginTop:-this.element.outerHeight()};break;case"right":e={marginLeft:-this.element.outerWidth()};break}this.element.animate(e,{queue:false,duration:g.closeDuration,easing:"linear",complete:function(){h.css({display:"none",overflow:""});if(f){f()}}})}};b.fx.slide.defaults=function(){return{list:[{name:"slide"}],openDuration:"fast",closeDuration:"fast"}};b.fx.property=function(e){this.element=e};b.fx.property.prototype={_animate:function(i,h,f,e){var j={overflow:"hidden"},k={},g=this.element;d.each(i,function(m,n){var l;switch(n){case"height":case"width":l=g[n]();break;case"opacity":l=1;break;default:l=g.css(n);break}j[n]=f?l:0;k[n]=f?0:l});g.css(j).show().animate(k,{queue:false,duration:h,easing:"linear",complete:function(){if(f){g.hide()}d.each(k,function(l){k[l]=""});g.css(d.extend({overflow:""},k));if(e){e()}}})},play:function(f,e){this._animate(f.properties,f.openDuration,false,e)},rewind:function(f,e){this._animate(f.properties,f.closeDuration,true,e)}};b.fx.property.defaults=function(){return{list:[{name:"property",properties:arguments}],openDuration:"fast",closeDuration:"fast"}};d(document).ready(function(){if(d.browser.msie&&typeof(Sys)!="undefined"&&typeof(Sys.Mvc)!="undefined"&&typeof(Sys.Mvc.FormContext)!="undefined"){Sys.Mvc.FormContext._getFormElementsWithName=function(f,e){return d.grep(f.getElementsByTagName("*"),function(g){return g.name==e})}}})})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.datepicker.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.datepicker.min.js new file mode 100644 index 000000000..465c08e59 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.datepicker.min.js @@ -0,0 +1 @@ +(function(d){var b=d.telerik;var a=null;var c=/\d/;d.extend(b.datetime,{parse:function(e,g,f,h,i){g=b.calendar.standardFormat(g)?b.calendar.standardFormat(g):g;if(c.test(e)){return b.datetime.parseMachineDate(e,g,h,i)}return b.datetime.parseByToken(e,f,h,i)},parseMachineDate:function(i,l,E,u){var q=-1;var x=-1;var r=-1;var h=0;var o=0;var s=0;var k="+10";var A;var m=false;var D=function(G){var F=0;while(p(G)){F++;t++}return F};var f=function(){var F=p("'");if(F){t++}return F};var p=function(F){return(t+10?1:-1)*t))%t):0)+(o?(e==b.cultureInfo.next?1:-1)*t:0))};var s=d.inArray(o||e,b.cultureInfo[h]);if(h.toLowerCase().indexOf("day")>-1){q=(s==0?7:s)-k.day();r(7,true)}else{q=s-k.month();r(12,false)}};var n=function(){var r=function(s){var t;switch(o){case"year":t=s==1?1:0;break;case"month":t=s==2?1:0;break;case"week":t=s==3?7:0;break;case"day":t=s==3?1:0;break}return t};var q=(e==b.cultureInfo.next?1:-1);k.year(k.year()+r(1)*q,k.month()+r(2)*q,k.date()+r(3)*q)};d.each(["today","tomorrow","yesterday","next","last"],function(r,q){if(e!==null){return}e=f(b.cultureInfo[q])});if(e!==null){p+=e.length;if(/[^\s\d]\s+[^\s\d]/i.test(i)){p++;d.each(["year","month","week","day"],function(r,q){if(o!==null){return}o=f(b.cultureInfo[q])});h=null;if(o===null){o=l()}if(o===null){return null}}else{switch(e){case b.cultureInfo.today:break;case b.cultureInfo.tomorrow:k.date(k.date()+1);break;case b.cultureInfo.yesterday:k.date(k.date()-1);break;default:k=null;break}if(g&&m){k=b.calendar.isInRange(k,g,m)?k:null}return k}}else{e=l();if(e!=null){j();if(g&&m){k=b.calendar.isInRange(k,g,m)?k:null}return k}else{return null}}if(h!==null){j()}else{n()}if(g&&m){k=b.calendar.isInRange(k,g,m)?k:null}return k}});b.datepicker=function(e,f){this.element=e;this.isValueChanged=false;d.extend(this,f);d("> .t-icon",e).bind("click",b.delegate(this,this.togglePopup));this.$input=d(".t-input",e).keydown(b.delegate(this,this.keyDown)).focus(b.delegate(this,this.show)).attr("autocomplete","off");this.focusedDate=this.selectedDate||(b.calendar.isInRange(this.focusedDate,this.minDate,this.maxDate)?this.focusedDate:new b.datetime(this.minDate.value));b.bind(this,{open:this.onOpen,close:this.onClose,change:this.onChange,load:this.onLoad})};d.extend(b.datepicker,{hideSharedCalendar:function(h){var f=a.data("associatedDatePicker");if(f){if(d.contains(f,h.target)||d.contains(a[0],h.target)){return}var g=d(f).data("tDatePicker");if(!g){g=d(f).tDatePicker().data("tDatePicker")}g.parseDate(d(".t-input",f).val());g.hide()}},adjustDate:function(e,h,g,f){if(e==0){b.datetime.modify(h,b.datetime.msPerDay*g)}else{if(e==1){h.addMonth(f)}else{h.addYear((e==2?f:10*f))}}}});b.datepicker.prototype={enable:function(){this.$input.attr("disabled",false);d(".t-icon",this.element).unbind("click").bind("click",b.delegate(this,this.togglePopup))},disable:function(f){this.$input.attr("disabled",true);d(".t-icon",this.element).unbind("click").bind("click",b.preventDefault)},$calendar:function(){if(!a){a=d(b.calendar.html(this.focusedDate,this.selectedDate,this.minDate,this.maxDate)).hide().addClass("t-datepicker-calendar").bind("click",function(i){i.stopPropagation()}).appendTo(document.body).tCalendar({selectedDate:this.selectedDate,minDate:this.minDate,maxDate:this.maxDate});d(document).bind("mousedown",b.datepicker.hideSharedCalendar)}var g=d(this.element).offset();g.top+=d(this.element).height();var h=b.fx._wrap(a);h.css(d.extend({position:"absolute"},g));var e=a.data("tCalendar");if(a.data("associatedDatePicker")!=this.element){e.minDate=this.minDate;e.maxDate=this.maxDate;e.selectedDate=this.selectedDate;e.goToView(0,this.focusedDate);a.unbind("change").bind("change",d.proxy(this.calendarChange,this)).unbind("navigate").bind("navigate",d.proxy(this.viewedMonthChanged,this)).data("associatedDatePicker",this.element);if(this.selectedDate){this.value(this.focusedDate)}}var f=e.currentView.index;if(!a.is(":visible")&&e.viewedMonth.value-this.focusedDate.value!=0){e.goToView(f,this.focusedDate).value(this.selectedDate)}b.calendar.focusDate(this.focusedDate,f,a);return a},isOpened:function(){return a&&a.data("associatedDatePicker")==this.element&&a.is(":visible")},viewedMonthChanged:function(i){var h=a.data("tCalendar");var f=h.viewedMonth;var g=h.currentView.index;if(g==0){this.focusedDate=this.selectedDate||this.focusedDate}else{this.focusedDate.year(f.year(),f.month(),this.focusedDate.date())}b.calendar.focusDate(this.focusedDate,g,a,i.direction)},value:function(g){if(arguments.length==0){return this.selectedDate===null?null:this.selectedDate.toDate()}var f=g===null?null:g.getDate||g.value?g:this.parse(g);var e=f===null;this.selectedDate=e?null:f.value?f:new b.datetime(f);if(!e){this.focusedDate=this.selectedDate}this.$input.val(e?"":b.calendar.formatDate(this.selectedDate.toDate(),this.format));if(this.isOpened()){this.$calendar().data("tCalendar").value(this.selectedDate)}return this},calendarChange:function(f){var g=new b.datetime(f.date);if(this.checkSelectedDate(this.selectedDate,g)){return this}this.$input.removeClass("t-state-error");this.hide()},checkSelectedDate:function(e,f){if(!e||(e.value>f.value||f.value>e.value)){this.value(f);return b.trigger(this.element,"change",{previousDate:e===null?null:e.toDate(),date:f.toDate()})}},togglePopup:function(f){f.preventDefault();var g=this.$input;if(this.isOpened()){this.parseDate(g.val());g.blur();this.hide()}else{g[0].focus()}},showPopup:function(){var f=this.parse(d(":input",this.element).val());this.selectedDate=f;if(f!==null){this.focusedDate=new b.datetime(f.value)}var g=this.$calendar();if(g){var e="auto";d(this.element).parents().andSelf().each(function(){e=d(this).css("zIndex");if(Number(e)){e=Number(e)+1;return false}});b.fx._wrap(g).css("zIndex",e).show();b.fx.play(this.effects,g,{direction:"bottom"})}},hidePopup:function(){if(this.isOpened()){b.fx.rewind(this.effects,this.$calendar(),{direction:"bottom"},function(){if(a){b.fx._wrap(a).hide()}})}},show:function(){this.showPopup();b.trigger(this.element,"open")},hide:function(){if(this.isOpened()){b.trigger(this.element,"close")}this.hidePopup()},keyDown:function(s){var k=d(s.target).val();if(s.keyCode==9){this.parseDate(k);this.hide()}if(s.keyCode==27){this.hide()}if(this.isOpened()&&d(".t-overlay",a).length>0){return}var o;var l=false;var q=this.$calendar();var n=q.data("tCalendar");var p=n.viewedMonth;var h=n.currentView;var i=n.currentView.index;var t=new b.datetime(this.focusedDate.value);var u=function(e,w,v){if(!d(e,q).hasClass("t-state-disabled")){if("navigateUp"==w){i+=1}o=v||false;n[w]();return true}else{return false}};var g=function(){var e=b.calendar.findTarget(t,i,q,false)[0];n.navigateDown(s,e,i);i=i==0?0:i-1;o=true};var m=function(e,x,v){var w=!v?-1:1;if(!u(e,x,v)){return false}if(i==0){t.addMonth(w)}else{t.addYear(w*(i==1?1:i==2?10:100))}return true};if(q.is(":visible")&&!s.shiftKey){switch(s.keyCode){case 37:l=true;if(s.ctrlKey){if(!m(".t-nav-prev","navigateToPast")){return}}else{b.datepicker.adjustDate(i,t,-1,-1);if(h.navCheck(t,p,false)){if(!u(".t-nav-prev","navigateToPast")){return}}}break;case 38:l=true;if(s.ctrlKey){u(".t-nav-fast","navigateUp")}else{b.datepicker.adjustDate(i,t,-7,-4);if(h.navCheck(t,p,false)){if(!u(".t-nav-prev","navigateToPast")){return}}}break;case 39:l=true;if(s.ctrlKey){if(!m(".t-nav-next","navigateToFuture",true)){return}}else{b.datepicker.adjustDate(i,t,1,1);if(h.navCheck(t,p,true)){if(!u(".t-nav-next","navigateToFuture",true)){return}}}break;case 40:l=true;if(s.ctrlKey){g()}else{b.datepicker.adjustDate(i,t,7,4);if(h.navCheck(t,p,true)){if(!u(".t-nav-next","navigateToFuture",true)){return}}}break;case 33:if(!m(".t-nav-prev","navigateToPast")){return}l=true;break;case 34:if(!m(".t-nav-next","navigateToFuture",true)){return}l=true;break;case 35:t=b.calendar.views[i].firstLastDay(t,false,n);l=true;break;case 36:t=b.calendar.views[i].firstLastDay(t,true,n);l=true;break;case 13:if(this.isValueChanged){this.parseDate(k);this.isValueChanged=false;break}l=true;if(i==0){d(s.target).removeClass("t-state-error");if(this.checkSelectedDate(this.selectedDate,this.focusedDate)){return}this.hide()}else{g()}break}}else{if(s.altKey&&s.keyCode==40){this.show();var r=this.parseDate(k);if(k!=""&&r===null){l=true}}else{if(s.keyCode==13){this.parseDate(k)}}}if(l){s.preventDefault();t=b.calendar.fitDateToRange(t,this.minDate,this.maxDate);b.calendar.focusDate(t,i,q,o);this.focusedDate=t}else{var j=s.keyCode;var f=function(v,e,w){return v>e&&v=this.hitTestOffset){c(document).bind(this.evt.ss,function(){return false}).unbind(this.evt.mm);if(this.onDragStart(h,this.$draggedElement)){}if(this.useDragClue){this.$dragClueStatus=c('')[0];this.$dragClue=c('
').html(this.createDragClue(this.$draggedElement)).prepend(this.$dragClueStatus).css({left:h.pageX+b,top:h.pageY+b}).appendTo(document.body)}c(document).bind(this.evt.mm,a.stop(this.moveClue,this)).bind(this.evt.ku,a.stop(this.keyboardListener,this));this.dragStarted=true}},removeDragClue:function(){if(this.$dragClue){this.$dragClue.remove();this.$dragClue=null;this.$dragClueStatus=null}},stopDrag:function(d){if(this.dragStarted){var f=this.onDrop(d,this.$draggedElement,this.useDragClue?this.$dragClue:undefined);if(this.useDragClue&&this.$dragClue){if(!f){this.$dragClue.animate(this.$draggedElement.offset(),"fast",c.proxy(this.removeDragClue,this))}else{if(typeof f=="function"){f(c.proxy(this.removeDragClue,this))}else{this.removeDragClue()}}}this.dragStarted=false}c(document).unbind([this.evt.ss,this.evt.mm,this.evt.mu,this.evt.ku].join(" "))},waitForDrag:function(f){var d=c(f.target);if(f.which!==1||!this.shouldDrag(d)){return}this.$draggedElement=d;this.hittestCoordinates={left:f.pageX,top:f.pageY};c(document).bind(this.evt.mm,a.stop(this.startDrag,this)).bind(this.evt.mu,a.stop(this.stopDrag,this));if(this.hitTestOffset==0){this.startDrag(f)}c(document).trigger("mousedown",f);return false},keyboardListener:function(d){if(d.keyCode==27){c(document).unbind([this.evt.ss,this.evt.mm,this.evt.mu,this.evt.ku].join(" "));this.onDragCancelled(d,this.$draggedElement);if(this.useDragClue&&this.$dragClue){this.$dragClue.animate(this.$draggedElement.offset(),"fast",c.proxy(this.removeDragClue,this))}this.dragStarted=false}}}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.editor.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.editor.min.js new file mode 100644 index 000000000..033302b2f --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.editor.min.js @@ -0,0 +1 @@ +(function(s){var ao=s.telerik;function F(aY){var aX={};for(var aW=0;aW1?aY:"0"+aY}).join("")},encode:function(aW){return aW.replace(/&/g,"&").replace(//g,">").replace(/\u00a0/g," ")},name:function(aW){return aW.nodeName.toLowerCase()},significantChildNodes:function(aW){return s.grep(aW.childNodes,function(aX){return aX.nodeType!=3||!C.isWhitespace(aX)})},lastTextNode:function(aX){if(aX.nodeType==3){return aX}var aW=null;for(var aY=aX.lastChild;aY;aY=aY.previousSibling){if(aW=C.lastTextNode(aY)){return aW}}return aW},is:function(aW,aX){return C.name(aW)==aX},isMarker:function(aW){return aW.className=="t-marker"},isWhitespace:function(aW){return aB.test(aW.nodeValue)},isBlock:function(aW){return L[C.name(aW)]},isEmpty:function(aW){return aH[C.name(aW)]},isInline:function(aW){return aP[C.name(aW)]},scrollTo:function(aW){aW.ownerDocument.body.scrollTop=s(ac(aW)?aW.parentNode:aW).offset().top},insertAt:function(aX,aW,aY){aX.insertBefore(aW,aX.childNodes[aY]||null)},insertBefore:function(aW,aX){return aX.parentNode.insertBefore(aW,aX)},insertAfter:function(aW,aX){return aX.parentNode.insertBefore(aW,aX.nextSibling)},remove:function(aW){aW.parentNode.removeChild(aW)},trim:function(aX){for(var aW=aX.childNodes.length-1;aW>=0;aW--){var aY=aX.childNodes[aW];if(ac(aY)){if(aY.nodeValue.replace(/\ufeff/g,"").length==0){C.remove(aY)}if(C.isWhitespace(aY)){C.insertBefore(aY,aX)}}else{if(aY.className!="t-marker"){C.trim(aY);if(aY.childNodes.length==0&&!C.isEmpty(aY)){C.remove(aY)}}}}return aX},parentOfType:function(aW,aX){do{aW=aW.parentNode}while(aW&&!(C.ofType(aW,aX)));return aW},ofType:function(aW,aX){return s.inArray(C.name(aW),aX)>=0},changeTag:function(a0,aX){var aZ=C.create(a0.ownerDocument,aX);var a3=a0.attributes;for(var aY=0;aY")},end:function(){a1.push("")}},b:{start:function(){a1.push("")},end:function(){a1.push("")}},i:{start:function(){a1.push("")},end:function(){a1.push("")}},u:{start:function(){a1.push('')},end:function(){a1.push("")}},font:{start:function(a4){a1.push('')},end:function(a2){a1.push("")}}};function aX(a3){var a9=[],bi=a3.attributes,bd=s.trim;for(var a7=0,bb=bi.length;a7bk.nodeName?1:bj.nodeName=0){a2=C.toHex(a2)}a1.push(bf);a1.push(":");a1.push(a2);a1.push(";")}}}else{if(a5=="src"||a5=="href"){a1.push(a3.getAttribute(a5,2))}else{a1.push(K[a5]?a5:bc)}}a1.push('"')}}function aW(a2,a3){for(var a4=a2.firstChild;a4;a4=a4.nextSibling){aZ(a4,a3)}}function aZ(a5,a6){var a9=a5.nodeType;if(a9==1){if(a5.attributes._moz_dirty&&C.is(a5,"br")){return}var a3=C.name(a5);var a7=a0[a3];if(a7){a7.start(a5);aW(a5);a7.end(a5);return}a1.push("<");a1.push(a3);aX(a5);if(aH[a3]){a1.push(" />")}else{a1.push(">");aW(a5,a6||C.is(a5,"pre"));a1.push("")}}else{if(a9==3){var a2=a5.nodeValue;if(!a6&&s.support.leadingWhitespace){var a8=a5.parentNode;var a4=(C.isInline(a8)?a8:a5).previousSibling;if(!a4||a4.innerHTML==""||C.isBlock(a4)){a2=a2.replace(/^[\r\n\v\f\t ]+/,"")}a2=a2.replace(/ +/," ")}a1.push(C.encode(a2))}else{if(a9==4){a1.push("")}else{if(a9==8){if(a5.data.indexOf("[CDATA[")<0){a1.push("")}else{a1.push("")}}}}}}aW(aY);return a1.join("")}var u=0,an=1,a=2,R=3;function q(aX){var aW=aX.startContainer;return aW.nodeType==9?aW:aW.ownerDocument}function D(aW){return aW.getSelection?aW.getSelection():new at(aW.document)}function ai(aX){var aW=q(aX);return aU(aW)}function aU(aW){return D(ax(aW))}function ax(aW){return aW.defaultView||aW.parentWindow}function aj(aW,aX,aZ){function aY(a2){var a0=aW.cloneRange();a0.collapse(a2);a0[a2?"setStartBefore":"setEndAfter"](aX);var a1=a0.extractContents();if(aZ){a1=C.trim(a1)}C[a2?"insertBefore":"insertAfter"](a1,aX)}aY(true);aY(false)}function M(aX){var aY=S.image(aX);if(aY){aX.setStartAfter(aY);aX.setEndAfter(aY)}var aW=ai(aX);aW.removeAllRanges();aW.addRange(aX)}function J(aW){s.extend(this,{ownerDocument:aW,startContainer:aW,endContainer:aW,commonAncestorContainer:aW,startOffset:0,endOffset:0,collapsed:true})}J.prototype={setStart:function(aW,aX){this.startContainer=aW;this.startOffset=aX;v(this);t(this,true)},setEnd:function(aW,aX){this.endContainer=aW;this.endOffset=aX;v(this);t(this,false)},setStartBefore:function(aW){this.setStart(aW.parentNode,p(aW))},setStartAfter:function(aW){this.setStart(aW.parentNode,p(aW)+1)},setEndBefore:function(aW){this.setEnd(aW.parentNode,p(aW))},setEndAfter:function(aW){this.setEnd(aW.parentNode,p(aW)+1)},selectNode:function(aW){this.setStartBefore(aW);this.setEndAfter(aW)},selectNodeContents:function(aW){this.setStart(aW,0);this.setEnd(aW,aW[aW.nodeType===1?"childNodes":"nodeValue"].length)},collapse:function(aW){if(aW){this.setEnd(this.startContainer,this.startOffset)}else{this.setStart(this.endContainer,this.endOffset)}},deleteContents:function(){var aX=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(az(this.commonAncestorContainer,this.startContainer))}this.collapse(true);(function aW(aY){while(aY.next()){aY.hasPartialSubtree()?aW(aY.getSubtreeIterator()):aY.remove()}})(new l(aX))},cloneContents:function(){var aW=q(this);return(function aX(a0){for(var aZ,aY=aW.createDocumentFragment();aZ=a0.next();){aZ=aZ.cloneNode(!a0.hasPartialSubtree());if(a0.hasPartialSubtree()){aZ.appendChild(aX(a0.getSubtreeIterator()))}aY.appendChild(aZ)}return aY})(new l(this))},extractContents:function(){var aX=this.cloneRange();if(this.startContainer!=this.commonAncestorContainer){this.setStartAfter(az(this.commonAncestorContainer,this.startContainer))}this.collapse(true);var aY=this;var aW=q(this);return(function aZ(a2){for(var a1,a0=aW.createDocumentFragment();a1=a2.next();){a2.hasPartialSubtree()?a1=a1.cloneNode(false):a2.remove(aY.originalRange);if(a2.hasPartialSubtree()){a1.appendChild(aZ(a2.getSubtreeIterator()))}a0.appendChild(a1)}return a0})(new l(aX))},insertNode:function(aW){if(ac(this.startContainer)){if(this.startOffset!=this.startContainer.nodeValue.length){ar(this.startContainer,this.startOffset)}C.insertAfter(aW,this.startContainer)}else{C.insertAt(this.startContainer,aW,this.startOffset)}this.setStart(this.startContainer,this.startOffset)},cloneRange:function(){return s.extend(new J(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var aX=this.startContainer.nodeName,aW=this.endContainer.nodeName;return[aX=="#text"?this.startContainer.nodeValue:aX,"(",this.startOffset,") : ",aW=="#text"?this.endContainer.nodeValue:aW,"(",this.endOffset,")"].join("")}};function m(aY,aW,a3,a0){if(aY==aW){return a0-a3}var a2=aW;while(a2&&a2.parentNode!=aY){a2=a2.parentNode}if(a2){return p(a2)-a3}a2=aY;while(a2&&a2.parentNode!=aW){a2=a2.parentNode}if(a2){return a0-p(a2)-1}var a1=C.commonAncestor(aY,aW);var aZ=aY;while(aZ&&aZ.parentNode!=a1){aZ=aZ.parentNode}if(!aZ){aZ=a1}var aX=aW;while(aX&&aX.parentNode!=a1){aX=aX.parentNode}if(!aX){aX=a1}if(aZ==aX){return 0}return p(aX)-p(aZ)}function t(aX,aY){function aW(a0){try{return m(a0.startContainer,a0.endContainer,a0.startOffset,a0.endOffset)<0}catch(aZ){return true}}if(aW(aX)){if(aY){aX.commonAncestorContainer=aX.endContainer=aX.startContainer;aX.endOffset=aX.startOffset}else{aX.commonAncestorContainer=aX.startContainer=aX.endContainer;aX.startOffset=aX.endOffset}aX.collapsed=true}}function v(aX){aX.collapsed=aX.startContainer==aX.endContainer&&aX.startOffset==aX.endOffset;var aW=aX.startContainer;while(aW&&aW!=aX.endContainer&&!k(aW,aX.endContainer)){aW=aW.parentNode}aX.commonAncestorContainer=aW}function aL(aW){return aW.createRange?aW.createRange():new J(aW)}function l(aX){s.extend(this,{range:aX,_current:null,_next:null,_end:null});if(aX.collapsed){return}var aW=aX.commonAncestorContainer;this._next=aX.startContainer==aW&&!ac(aX.startContainer)?aX.startContainer.childNodes[aX.startOffset]:az(aW,aX.startContainer);this._end=aX.endContainer==aW&&!ac(aX.endContainer)?aX.endContainer.childNodes[aX.endOffset]:az(aW,aX.endContainer).nextSibling}l.prototype={hasNext:function(){return !!this._next},next:function(){var aW=this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;if(ac(this._current)){if(this.range.endContainer==this._current){(aW=aW.cloneNode(true)).deleteData(this.range.endOffset,aW.length-this.range.endOffset)}if(this.range.startContainer==this._current){(aW=aW.cloneNode(true)).deleteData(0,this.range.startOffset)}}return aW},traverse:function(aX){function aW(){this._current=this._next;this._next=this._current&&this._current.nextSibling!=this._end?this._current.nextSibling:null;return this._current}var aY;while(aY=aW.call(this)){if(this.hasPartialSubtree()){this.getSubtreeIterator().traverse(aX)}else{aX(aY)}}return aY},remove:function(a1){var a0=this.range.startContainer==this._current;var aY=this.range.endContainer==this._current;if(ac(this._current)&&(a0||aY)){var aX=a0?this.range.startOffset:0;var aW=aY?this.range.endOffset:this._current.length;var a3=aW-aX;if(a1&&(a0||aY)){if(this._current==a1.startContainer&&aX<=a1.startOffset){a1.startOffset-=a3}if(this._current==a1.endContainer&&aW<=a1.endOffset){a1.endOffset-=a3}}this._current.deleteData(aX,a3)}else{var a2=this._current.parentNode;if(a1&&(this.range.startContainer==a2||this.range.endContainer==a2)){var aZ=p(this._current);if(a2==a1.startContainer&&aZ<=a1.startOffset){a1.startOffset-=1}if(a2==a1.endContainer&&aZ0&&aZ.previousSibling);a2.setEndPoint(aW?"EndToStart":"EndToEnd",a1);var a0=aZ.nextSibling;if(!a0){a0=aZ.previousSibling;if(a0&&ac(a0)){aX.setEnd(a0,a0.nodeValue.length);C.remove(aZ)}else{aX.selectNodeContents(aY);C.remove(aZ);aX.endOffset-=1}return}C.remove(aZ);if(ac(a0)){aX[aW?"setStart":"setEnd"](a0,a2.text.length)}else{aX[aW?"setStartBefore":"setEndBefore"](a0)}}function ag(aW){this.enumerate=function(){var aY=[];function aX(aZ){if(C.is(aZ,"img")||(aZ.nodeType==3&&!C.isWhitespace(aZ))){aY.push(aZ)}else{aZ=aZ.firstChild;while(aZ){aX(aZ);aZ=aZ.nextSibling}}}new l(aW).traverse(aX);return aY}}function j(aW){return new ag(aW).enumerate()}function X(a0){var aW=[];for(var aX=0,aZ=a0.length;aX'}aY.selectNodeContents(a2)}}aY.collapse(true)};this.add=function(aX,aZ){if(aZ&&aX.collapsed){this.addCaret(aX);aX=S.expand(aX)}var aY=aX.cloneRange();aY.collapse(false);this.end=C.create(q(aX),"span",{className:"t-marker"});aY.insertNode(this.end);aY=aX.cloneRange();aY.collapse(true);this.start=this.end.cloneNode(true);aY.insertNode(this.start);aX.setStartBefore(this.start);aX.setEndAfter(this.end);g(aX.commonAncestorContainer);return aX};this.remove=function(a4){var aX=this.start,a9=this.end;g(a4.commonAncestorContainer);while(!aX.nextSibling&&aX.parentNode){aX=aX.parentNode}while(!a9.previousSibling&&a9.parentNode){a9=a9.parentNode}var aZ=(aX.previousSibling&&aX.previousSibling.nodeType==3)&&(aX.nextSibling&&aX.nextSibling.nodeType==3);var a5=(a9.previousSibling&&a9.previousSibling.nodeType==3)&&(a9.nextSibling&&a9.nextSibling.nodeType==3);aX=aX.nextSibling;a9=a9.previousSibling;var a8=false;var a2=false;if(aX==this.end){a2=!!this.start.previousSibling;aX=a9=this.start.previousSibling||this.end.nextSibling;a8=true}C.remove(this.start);C.remove(this.end);var a7=a8?ac(aX)?aX.nodeValue.length:aX.childNodes.length:0;var a0=ac(a9)?a9.nodeValue.length:a9.childNodes.length;if(aX.nodeType==3){while(aX.previousSibling&&aX.previousSibling.nodeType==3){aX=aX.previousSibling;a7+=aX.nodeValue.length}}if(a9.nodeType==3){while(a9.previousSibling&&a9.previousSibling.nodeType==3){a9=a9.previousSibling;a0+=a9.nodeValue.length}}var a3=p(aX),a6=aX.parentNode;var a1=p(a9),aY=a9.parentNode;for(var bb=aX;bb.previousSibling;bb=bb.previousSibling){if(bb.nodeType==3&&bb.previousSibling.nodeType==3){a3--}}for(var ba=a9;ba.previousSibling;ba=ba.previousSibling){if(ba.nodeType==3&&ba.previousSibling.nodeType==3){a1--}}g(a6);if(aX.nodeType==3){aX=a6.childNodes[a3]}g(aY);if(a9.nodeType==3){a9=aY.childNodes[a1]}if(a8){if(aX.nodeType==3){a4.setStart(aX,a7)}else{a4[a2?"setStartAfter":"setStartBefore"](aX)}a4.collapse(true)}else{if(aX.nodeType==3){a4.setStart(aX,a7)}else{a4.setStartBefore(aX)}if(a9.nodeType==3){a4.setEnd(a9,a0)}else{a4.setEndAfter(a9)}}if(aW){this.removeCaret(a4)}}}var ap=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/;var S={nodes:function(aX){var aW=j(aX);if(!aW.length){aX.selectNodeContents(aX.commonAncestorContainer);aW=j(aX);if(!aW.length){aW=C.significantChildNodes(aX.commonAncestorContainer)}}return aW},image:function(aX){var aW=[];new l(aX).traverse(function(aY){if(C.is(aY,"img")){aW.push(aY)}});if(aW.length==1){return aW[0]}},expand:function(aX){var aY=aX.cloneRange();var a1=aY.startContainer.childNodes[aY.startOffset==0?0:aY.startOffset-1];var a2=aY.endContainer.childNodes[aY.endOffset];if(!ac(a1)||!ac(a2)){return aY}var aZ=a1.nodeValue;var a0=a2.nodeValue;if(aZ==""||a0==""){return aY}var aW=aZ.split("").reverse().join("").search(ap);var a3=a0.search(ap);if(aW==0||a3==0){return aY}a3=a3==-1?a0.length:a3;aW=aW==-1?0:aZ.length-aW;aY.setStart(a1,aW);aY.setEnd(a2,a3);return aY},isExpandable:function(aX){var a2=aX.startContainer;var a1=q(aX);if(a2==a1||a2==a1.body){return false}var aY=aX.cloneRange();var aW=a2.nodeValue;if(!aW){return false}var aZ=aW.substring(0,aY.startOffset);var a0=aW.substring(aY.startOffset);var a3=0,a4=0;if(aZ!=""){a3=aZ.split("").reverse().join("").search(ap)}if(a0!=""){a4=a0.search(ap)}return a3!=0&&a4!=0}};function c(aX){var aY=new ak(aX.range);var aW=new aa();this.formatter=aX.formatter;this.getRange=function(){return aY.toRange()};this.lockRange=function(aZ){return aW.add(this.getRange(),aZ)};this.releaseRange=function(aZ){aW.remove(aZ);M(aZ)};this.undo=function(){aY.body.innerHTML=aY.html;M(aY.toRange())};this.redo=function(){this.exec()};this.exec=function(){var aZ=this.lockRange(true);this.formatter.editor=this.editor;this.formatter.toggle(aZ);this.releaseRange(aZ)}}function aR(aY,aX){var aW=aY.body;this.redo=function(){aW.innerHTML=aX.html;M(aX.toRange())};this.undo=function(){aW.innerHTML=aY.html;M(aY.toRange())}}function aM(aW){c.call(this,aW);this.managesUndoRedo=true;this.exec=function(){var aY=this.editor;var aX=aY.getRange();var aZ=new ak(aX);aY.clipboard.paste(aW.value||"");aY.undoRedoStack.push(new aR(aZ,new ak(aY.getRange())));aY.focus()}}function w(){V.call(this);this.command=function(aW){return new aM(aW)};this.update=function(aW,aX){aW.data("tSelectBox").close()};this.init=function(aY,aW){var aX=aW.editor;aY.tSelectBox({data:aX.insertHtml,onItemCreate:function(aZ){aZ.html=''+aZ.dataItem.Text+""},onChange:function(aZ){V.exec(aX,"insertHtml",aZ.value)},highlightFirst:false}).find(".t-input").html(aX.localization.insertHtml)}}function P(){var aX=[],aW=-1;this.push=function(aY){aX=aX.slice(0,aW+1);aW=aX.push(aY)-1};this.undo=function(){if(this.canUndo()){aX[aW--].undo()}};this.redo=function(){if(this.canRedo()){aX[++aW].redo()}};this.canUndo=function(){return aW>=0};this.canRedo=function(){return aW!=aX.length-1}}function aK(aW){this.keydown=function(aZ){var aY=aW.keyboard;var aX=aY.isTypingKey(aZ);if(!aX){au(aW)}if(aX&&!aY.typingInProgress()){this.startRestorePoint=new ak(aW.getRange());aY.startTyping(s.proxy(function(){this.endRestorePoint=new ak(aW.getRange());aW.undoRedoStack.push(new aR(this.startRestorePoint,this.endRestorePoint))},this));return true}return false};this.keyup=function(aX){var aY=aW.keyboard;if(aY.typingInProgress()){aY.endTyping();return true}return false}}function z(aX){var aW=false;this.createUndoCommand=function(){this.endRestorePoint=new ak(aX.getRange());aX.undoRedoStack.push(new aR(this.startRestorePoint,this.endRestorePoint));this.startRestorePoint=this.endRestorePoint};this.changed=function(){if(this.startRestorePoint){return this.startRestorePoint.html!=aX.body.innerHTML}return false},this.keydown=function(aY){var aZ=aX.keyboard;if(aZ.isModifierKey(aY)){if(aZ.typingInProgress()){aZ.endTyping(true)}this.startRestorePoint=new ak(aX.getRange());return true}if(aZ.isSystem(aY)){aW=true;if(this.changed()){aW=false;this.createUndoCommand()}return true}return false};this.keyup=function(aY){if(aW&&this.changed()){aW=false;this.createUndoCommand(aY);return true}return false}}function aE(aX){var aZ=false;var a2;var aY;function aW(a3){return(a3>=48&&a3<=90)||(a3>=96&&a3<=111)||(a3>=186&&a3<=192)||(a3>=219&&a3<=222)}this.toolFromShortcut=function(a5,a7){var a4=String.fromCharCode(a7.keyCode);for(var a6 in a5){var a3=a5[a6];if((a3.key==a4||a3.key==a7.keyCode)&&!!a3.ctrl==a7.ctrlKey&&!!a3.alt==a7.altKey&&!!a3.shift==a7.shiftKey){return a6}}};this.isTypingKey=function(a4){var a3=a4.keyCode;return(aW(a3)&&!a4.ctrlKey&&!a4.altKey)||a3==32||a3==13||a3==8||(a3==46&&!a4.shiftKey&&!a4.ctrlKey&&!a4.altKey)};this.isModifierKey=function(a4){var a3=a4.keyCode;return(a3==17&&!a4.shiftKey&&!a4.altKey)||(a3==16&&!a4.ctrlKey&&!a4.altKey)||(a3==18&&!a4.ctrlKey&&!a4.shiftKey)};this.isSystem=function(a3){return a3.keyCode==46&&a3.ctrlKey&&!a3.altKey&&!a3.shiftKey};this.startTyping=function(a3){aY=a3;aZ=true};function a0(){aZ=false;aY()}this.endTyping=function(a3){this.clearTimeout();if(a3){a0()}else{a2=window.setTimeout(a0,1000)}};this.typingInProgress=function(){return aZ};this.clearTimeout=function(){window.clearTimeout(a2)};function a1(a5,a4){for(var a3=0;a3$/g,"li>");var a2=aW(a5);var a4=a0.getRange();a4.deleteContents();if(a4.startContainer==a0.document){a4.selectNodeContents(a0.body)}var a6=new aa();var a9=a6.addCaret(a4);var a8=aY(a2,a9);var a7=false;if(!/body|td/.test(C.name(a8))&&(a2||C.isInline(a8))){a4.selectNode(a9);aj(a4,a8,true);a7=true}var ba=aX(a5);a4.insertNode(ba);a8=aY(a2,a9);if(a7){while(a9.parentNode!=a8){C.unwrap(a9.parentNode)}C.unwrap(a9.parentNode)}g(a4.commonAncestorContainer);a9.style.display="inline";C.scrollTo(a9);a6.removeCaret(a4);M(a4)}}function f(){var aW=[//g,"",/mso-[^;"]*;?/ig,"",/<\/?(meta|link|style|o:|v:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:)[^>]*>)?/ig,""];this.applicable=function(aZ){return/class="?Mso|style="[^"]*mso-/i.test(aZ)};function aX(aZ){if(/^[\u2022\u00b7\u00a7\u00d8o\-]\u00a0+/.test(aZ)){return"ul"}if(/^\s*\w+[\.\)]\u00a0{2,}/.test(aZ)){return"ol"}}function aY(bc){var a4=C.create(document,"div",{innerHTML:bc});var bb=s(G.join(","),a4);var a6=-1,a1,ba={ul:{},ol:{}},aZ=a4;for(var a7=0;a7]*>/g,"").replace(/ /g,"\u00a0");var a5=aX(bc);if(!a5||C.name(a2)!="p"){if(a2.innerHTML==""){C.remove(a2)}else{ba={ul:{},ol:{}};aZ=a4;a6=-1}continue}var a8=parseFloat(a2.style.marginLeft||0);var a9=ba[a5][a8];if(a8>a6||!a9){a9=C.create(document,a5);if(aZ==a4){C.insertBefore(a9,a2)}else{aZ.appendChild(a9)}ba[a5][a8]=a9}if(a1!=a5){for(var a3 in ba){for(var a0 in ba[a3]){if(s.contains(a9,ba[a3][a0])){delete ba[a3][a0]}}}}C.remove(a2.firstChild);aZ=C.create(document,"li",{innerHTML:a2.innerHTML});a9.appendChild(aZ);C.remove(a2);a6=a8;a1=a5}return a4.innerHTML}this.clean=function(a0){for(var aZ=0,a1=aW.length;aZ]*"?/ig,"");return a0}}function i(aW){function aX(a0){var aY=0;for(var aZ=a0.parentNode.firstChild;aZ;aZ=aZ.nextSibling){if(aZ!=a0&&aZ.className!="t-marker"&&aZ.nodeType==1){aY++}}return aY}this.findSuitable=function(aZ,aY){if(!aY&&aX(aZ)>0){return null}return C.parentOfType(aZ,aW[0].tags)};this.findFormat=function(a2){for(var aY=0;aY1){var a1=a3.pop();var a2=a3[a3.length-1];if(a1.previousSibling&&a1.previousSibling.className=="t-marker"){a2.appendChild(a1.previousSibling)}if(a1.previousSibling==a2&&a1.style.cssText==a2.style.cssText){while(a1.firstChild){a2.appendChild(a1.firstChild)}C.remove(a1)}}}}function aV(aX,aW){i.call(this,aX);function aY(a2){var bd=a2.attributes,ba=s.trim;for(var a1=0,a8=bd.length;a1=0?C.toHex(a0):a0}}}}return}function aZ(a4){var a5=s(ac(a4)?a4.parentNode:a4);var a3=a5.parents().andSelf();for(var a1=0,a2=a3.length;a1'+a1.dataItem.Text+""}}}function aT(aX){V.call(this,aX);var aW=new aV([{tags:["span"]}],aX.cssAttr);this.update=function(aY){aY.data("tColorPicker").close()};this.command=function(aY){return new aF(s.extend(aY,{formatter:function(){var aZ={};aZ[aX.domAttr]=aY.value;return new E([{tags:["span"]}],{style:aZ},aX.cssAttr)}}))};this.init=function(a0,aY){var aZ=aY.editor;a0.tColorPicker({selectedColor:"#000000",onChange:function(a1){V.exec(aZ,aX.name,a1.value)}})}}function Z(){V.call(this);var aW=new aV([{tags:["span"]}],"className");this.command=function(aX){return new aF(s.extend(aX,{formatter:function(){return new E([{tags:["span"]}],{className:aX.value})}}))};this.update=function(aX,aZ){var aY=aX.data("tSelectBox");aY.close();aY.value(aW.getFormat(aZ))};this.init=function(aZ,aX){var aY=aX.editor;aZ.tSelectBox({data:aY.style,title:aY.localization.style,onItemCreate:function(a0){var a1=C.inlineStyle(aY.document,"span",{className:a0.dataItem.Value});a0.html=''+a0.html+""},onChange:function(a0){V.exec(aY,"style",a0.value)}})}}function x(aX){function aW(a0,a1){for(var aY=0;aY'+a1.dataItem.Text+""},onChange:function(a0){V.exec(aY,"formatBlock",a0.value)},highlightFirst:false})}}function aN(aW){c.call(this,aW);this.exec=function(){var aZ=this.getRange();var a7=q(aZ);var a5=s.browser.msie?"":'
';var a8=C.parentOfType(aZ.startContainer,["p"]),aX=C.parentOfType(aZ.endContainer,["p"]),aY=(a8&&!aX)||(!a8&&aX);aZ.deleteContents();var a6=C.create(a7,"a");aZ.insertNode(a6);var a0=C.parentOfType(a6,"li".split(","));var a1;if(a0){var a3=aZ.cloneRange();a3.selectNode(a0);if(j(a3).length==0){var a9=C.create(a7,"p");if(a0.nextSibling){aj(a3,a0.parentNode)}C.insertAfter(a9,a0.parentNode);C.remove(a0.parentNode.childNodes.length==1?a0.parentNode:a0);a9.innerHTML=a5;a1=a9}}if(!a1){if(!a0){new U([{tags:["p"]}]).apply([a6])}aZ.selectNode(a6);var a2=C.parentOfType(a6,[a0?"li":"p"]);aj(aZ,a2,aY);var a4=a2.previousSibling;if(C.is(a4,"li")&&a4.firstChild&&!C.is(a4.firstChild,"br")){a4=a4.firstChild}a1=a2.nextSibling;if(C.is(a1,"li")&&a1.firstChild&&!C.is(a1.firstChild,"br")){a1=a1.firstChild}C.remove(a2);if(a4.firstChild&&C.is(a4.firstChild,"br")){C.remove(a4.firstChild)}if(ac(a4)&&a4.nodeValue==""){a4=a4.parentNode}if(a4&&a4.innerHTML==""){a4.innerHTML=a5}if(a1.firstChild&&C.is(a1.firstChild,"br")){C.remove(a1.firstChild)}if(ac(a1)&&a1.nodeValue==""){a1=a1.parentNode}if(a1.innerHTML==""){a1.innerHTML=a5}g(a4)}g(a1);aZ.selectNodeContents(a1);aZ.collapse(true);C.scrollTo(a1);M(aZ)}}function d(aW){c.call(this,aW);this.exec=function(){var aY=this.getRange();aY.deleteContents();var aX=C.create(q(aY),"br");aY.insertNode(aX);aX.parentNode.normalize();if(!s.browser.msie&&(!aX.nextSibling||C.isWhitespace(aX.nextSibling))){var aZ=aX.cloneNode(true);aZ.setAttribute("_moz_dirty","");C.insertAfter(aZ,aX)}aY.setStartAfter(aX);aY.collapse(true);M(aY)}}function am(aX){var aW=[aX=="ul"?"ol":"ul",aX];x.call(this,[{tags:aW}]);this.isFormatted=function(a1){var aY=[],aZ;for(var a0=0;a01){C.insertAfter(aZ[aZ.length-1],a0);C.insertAfter(aZ[1],a0);C[aY.length>0?"insertBefore":"insertAfter"](aZ[0],a0)}}else{var a1=new b([{tags:["a"]}],a2);a1.finder=this.finder;a1.apply(aY)}}}function al(aW){aW.formatter={toggle:function(aX){new b([{tags:["a"]}]).remove(j(aX))}};c.call(this,aW)}function Y(aX){c.call(this,aX);var aW;this.async=true;var aY=new aS();this.exec=function(){var a3=this.getRange();var a1=a3.collapsed;a3=this.lockRange(true);var a6=j(a3);var a5=null;var a0=this;function a7(bd){var bc=s("#t-editor-link-url",a4.element).val();if(bc&&bc!="http://"){aW={href:bc};var a9=s("#t-editor-link-title",a4.element).val();if(a9){aW.title=a9}var ba=s("#t-editor-link-text",a4.element).val();if(ba!==a5){aW.innerHTML=ba}var bb=s("#t-editor-link-target",a4.element).val();if(bb!="false"){aW.target="_blank"}aY.apply(a3,aW)}a2(bd);if(a0.change){a0.change()}}function a2(a9){a9.preventDefault();a4.destroy();ax(q(a3)).focus();a0.releaseRange(a3)}var a8=a6.length?aY.finder.findSuitable(a6[0]):null;var aZ=a6.length<=1||(a6.length==2&&a1);var a4=ao.window.create(s.extend({},this.editor.dialogOptions,{title:"Insert link",html:new s.telerik.stringBuilder().cat('
').cat("
    ").cat('
  1. ').catIf('
  2. ',aZ).cat('
  3. ').cat('
  4. ').cat("
").cat('
').cat('').cat(" or ").cat('Close').cat("
").cat("
").string(),onClose:a2})).hide().find(".t-dialog-insert").click(a7).end().find(".t-dialog-close").click(a2).end().find(".t-form-text-row input").keydown(function(a9){if(a9.keyCode==13){a7(a9)}else{if(a9.keyCode==27){a2(a9)}}}).end().delegate(".t-button","mouseenter",ao.buttonHover).delegate(".t-button","mouseleave",ao.buttonLeave).find("#t-editor-link-url").val(a8?a8.getAttribute("href",2):"http://").end().find("#t-editor-link-text").val(a6.length>0?(a6.length==1?a6[0].nodeValue:a6[0].nodeValue+a6[1].nodeValue):"").end().find("#t-editor-link-title").val(a8?a8.title:"").end().find("#t-editor-link-target").val(a8?a8.target=="_blank":"false").end().show().data("tWindow").center();if(aZ&&a6.length>0){a5=s("#t-editor-link-text",a4.element).val()}s("#t-editor-link-url",a4.element).focus().select()},this.redo=function(){var aZ=this.lockRange(true);aY.apply(aZ,aW);this.releaseRange(aZ)}}function aO(aX){V.call(this,s.extend(aX,{command:al}));var aW=new H();this.init=function(aY){aY.attr("unselectable","on").addClass("t-state-disabled")};this.update=function(aY,aZ){aY.toggleClass("t-state-disabled",!aW.findSuitable(aZ[0])).removeClass("t-state-hover")}}function aJ(aX){c.call(this,aX);this.async=true;var aW;function aY(aZ,a0){if(aW.src&&aW.src!="http://"){if(!aZ){aZ=C.create(q(a0),"img",aW);aZ.onload=aZ.onerror=function(){aZ.removeAttribute("complete");aZ.removeAttribute("width");aZ.removeAttribute("height")};a0.deleteContents();a0.insertNode(aZ);a0.setStartAfter(aZ);a0.setEndAfter(aZ);M(a0);return true}else{C.attr(aZ,aW)}}return false}this.redo=function(){var aZ=this.lockRange();if(!aY(S.image(aZ),aZ)){this.releaseRange(aZ)}};this.exec=function(){var a2=this.lockRange();var aZ=false;var a4=S.image(a2);var a0=this;function a5(a6){aW={src:s("#t-editor-image-url",a3.element).val(),alt:s("#t-editor-image-title",a3.element).val()};aZ=aY(a4,a2);a1(a6);if(a0.change){a0.change()}}function a1(a6){a6.preventDefault();a3.destroy();ax(q(a2)).focus();if(!aZ){a0.releaseRange(a2)}}var a3=ao.window.create(s.extend({},this.editor.dialogOptions,{title:"Insert image",html:new s.telerik.stringBuilder().cat('
').cat("
    ").cat('
  1. ').cat('
  2. ').cat("
").cat('
').cat('').cat(" or ").cat('Close').cat("
").cat("
").string(),onClose:a1})).hide().find(".t-dialog-insert").click(a5).end().find(".t-dialog-close").click(a1).end().find(".t-form-text-row input").keydown(function(a6){if(a6.keyCode==13){a5(a6)}else{if(a6.keyCode==27){a1(a6)}}}).end().delegate(".t-button","mouseenter",ao.buttonHover).delegate(".t-button","mouseleave",ao.buttonLeave).find("#t-editor-image-url").val(a4?a4.getAttribute("src",2):"http://").end().find("#t-editor-image-title").val(a4?a4.alt:"").end().show().data("tWindow").center();s("#t-editor-image-url",a3.element).focus().select()}}ao.selectbox=function(aW,aX){var a4;var aZ=s(aW);var a1=aZ.find(".t-input");var aY=new ao.dropDown({outerHeight:aZ.outerHeight(),outerWidth:aZ.outerWidth(),zIndex:ao.list.getZIndex(aZ),effects:ao.fx.slide.defaults(),onOpen:function(){var a5=aZ.offset();aY.position(a5.top,a5.left);return true},onItemCreate:aX.onItemCreate,onClick:function(a5){a3(aX.data[s(a5.item).index()].Value);aX.onChange({value:a4})}});function a0(){if(!aY.$items){aY.dataBind(aX.data)}}function a2(a5){a1.html(a5)}function a3(a7){a0();var a6=-1;for(var a5=0,a8=aX.data.length;a50;if(a6&&!s.contains(aW,a7.target)&&!s.contains(a5.parent()[0],a7.target)){aY.close()}},this))};s.fn.tSelectBox=function(aW){return ao.create(this,{name:"tSelectBox",init:function(aX,aY){return new ao.selectbox(aX,aY)},options:aW})};s.fn.tSelectBox.defaults={effects:s.fn.tDropDownList.defaults.effects};ao.colorpicker=function(aW,aX){this.element=aW;var aY=s(aW);s.extend(this,aX);aY.bind("click",s.proxy(this.click,this));if(this.selectedColor){aY.find(".t-selected-color").css("background-color",this.selectedColor)}s(aW.ownerDocument).bind("mousedown",s.proxy(function(aZ){if(!s(aZ.target).closest(".t-colorpicker-popup").length){this.close()}},this));ao.bind(this,{change:this.onChange,load:this.onLoad})};ao.colorpicker.prototype={select:function(aW){if(aW){aW=C.toHex(aW);if(!ao.trigger(this.element,"change",{value:aW})){this.value(aW);this.close()}}else{ao.trigger(this.element,"change",{value:this.selectedColor})}},open:function(){var aW=this.popup();var aZ=s(this.element);var aY=aZ.offset();aY.top+=aZ.outerHeight();var aX="auto";aZ.parents().andSelf().each(function(){aX=s(this).css("zIndex");if(Number(aX)){aX=Number(aX)+1;return false}});ao.fx._wrap(aW).css(s.extend({position:"absolute",zIndex:aX},aY));aW.find(".t-item").bind("click",s.proxy(function(a1){var a0=s(a1.target,a1.target.ownerDocument).css("background-color");this.select(a0)},this));ao.fx.play(this.effects,aW,{direction:"bottom"})},close:function(){if(!this.$popup){return}ao.fx.rewind(this.effects,this.$popup,{direction:"bottom"},s.proxy(function(){C.remove(this.$popup[0].parentNode);this.$popup=null},this))},toggle:function(){if(!this.$popup||!this.$popup.is(":visible")){this.open()}else{this.close()}},click:function(aW){if(s(aW.target).closest(".t-tool-icon").length>0){this.select()}else{this.toggle()}},value:function(aW){if(!aW){return this.selectedColor}aW=C.toHex(aW);this.selectedColor=aW;s(".t-selected-color",this.element).css("background-color",aW)},popup:function(){if(!this.$popup){this.$popup=s(ao.colorpicker.buildPopup(this)).hide().appendTo(document.body)}return this.$popup}};s.extend(ao.colorpicker,{buildPopup:function(aW){var aZ=new ao.stringBuilder();aZ.cat('
').cat('
    ');var a1=aW.data;var aY=(aW.value()||"").substring(1);for(var aX=0,a0=a1.length;aX')}aZ.cat("
");return aZ.string()}});s.fn.tColorPicker=function(aW){return ao.create(this,{name:"tColorPicker",init:function(aX,aY){return new ao.colorpicker(aX,aY)},options:aW})};s.fn.tColorPicker.defaults={data:"000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7".split(","),selectedColor:null,effects:s.fn.tDropDownList.defaults.effects};function aQ(){var aX=new x([{tags:G}]);function aW(aY){return aY.style.marginLeft||0}this.apply=function(a3){var a1=aX.findSuitable(a3);if(a1.length){var a0=[];for(var aZ=0;aZul")[0];if(!a6){a6=C.create(a4.ownerDocument,C.name(a7));a2.append(a6)}while(a4&&a4.parentNode==a7){a6.appendChild(a4);a4=a0.shift()}}else{var aY=parseInt(aW(a4))+30;C.style(a4,{marginLeft:aY})}}}else{var a5=new U([{tags:G}],{style:{marginLeft:30}});a5.apply(a3)}};this.remove=function(a0){var a2=aX.findSuitable(a0);for(var aY=0;aY",{src:'javascript:""',frameBorder:"0",className:"t-content"}).css("display","").insertBefore(aW)[0];var aX=a0.contentWindow||a0;var aZ=aX.document||a0.contentDocument;var aY=aW.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1");aZ.designMode="On";aZ.open();aZ.write(new ao.stringBuilder().cat('').cat('').cat('").cat(s.map(a1,function(a2){return[''].join("")}).join("")).cat('').cat(aY).cat("").string());aZ.close();return aX}function T(aW){ao.trigger(aW.element,"selectionChange")}function au(aW){if(aW.pendingFormats.length==0){return}aW.pendingFormats.reverse();s.each(aW.pendingFormats,function(){for(var aX=this.firstChild;aX;aX=aX.nextSibling){while(aX.nodeType==3&&(charIndex=aX.nodeValue.indexOf("\ufeff"))>=0){aX.deleteData(charIndex,1)}}});s.each(aW.pendingFormats,function(){if(this.innerHTML==""&&this.parentNode){C.remove(this)}});aW.pendingFormats=[]}ao.editor=function(aW,aX){if(/Mobile.*Safari/.test(navigator.userAgent)){return}var aY=this;this.element=aW;var aZ=s(aW);aZ.closest("form").bind("submit",function(){aY.update()});s.extend(this,aX);ao.bind(this,{load:this.onLoad,selectionChange:this.onSelectionChange,change:this.onChange,execute:this.onExecute});this.textarea=aZ.find("textarea").attr("autocomplete","off")[0];this.window=av(s(this.textarea),this.stylesheets);this.document=this.window.contentDocument||this.window.document;this.body=this.document.body;this.keyboard=new aE([new aK(this),new z(this)]);this.clipboard=new ay(this);this.pendingFormats=[];this.undoRedoStack=new P();function a3(a4){var a5=s.grep(a4.className.split(" "),function(a6){return !/^t-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(a6)});return a5[0]?a5[0].substring(2):"custom"}function a2(a5,a4){if(!a4.key){return a5}return new ao.stringBuilder().cat(a5).cat(" (").catIf("Ctrl + ",a4.ctrl).catIf("Shift + ",a4.shift).catIf("Alt + ",a4.alt).cat(a4.key).cat(")").string()}s(this.window).bind("blur",function(){var a4=aY.textarea.value;var a5=aY.encodedValue();aY.update(a5);if(a5!=a4){ao.trigger(aY.element,"change")}});var a1=".t-editor-toolbar > li > *";var a0=".t-editor-button .t-tool-icon:not(.t-state-disabled)";aZ.delegate(a0,"mouseenter",ao.hover).delegate(a0,"mouseleave",ao.leave).delegate(a0,"mousedown",ao.preventDefault).delegate(a0,"click",ao.stopAll(function(a4){aY.focus();aY.exec(a3(this))})).find(a1).each(function(){var a6=a3(this);var a4=aY.tools[a6];if(!a4){return}var a5=a2(aY.localization[a6],a4);a4.init(s(this),{title:a5,editor:aY})}).end().bind("selectionChange",function(){var a5=aY.getRange();aY.selectionRestorePoint=new ak(a5);var a4=j(a5);if(!a4.length){a4=[a5.startContainer]}aZ.find(a1).each(function(){var a6=aY.tools[a3(this)];if(a6){a6.update(s(this),a4)}})});s(this.document).bind("keyup",function(a4){var a5=[8,9,13,33,34,35,36,37,38,39,40,40,45,46];if(s.inArray(a4.keyCode,a5)>-1){T(aY)}}).keydown(function(a5){var a4=aY.keyboard.toolFromShortcut(aY.tools,a5);if(a4){a5.preventDefault();aY.exec(a4);return false}aY.keyboard.clearTimeout();aY.keyboard.keydown(a5)}).keyup(function(a4){aY.keyboard.keyup(a4)}).mouseup(function(){T(aY)});s(this.body).bind("cut paste",function(a4){aY.clipboard["on"+a4.type](a4)})};s.extend(ao.editor,{Dom:C,RestorePoint:ak,Marker:aa,RangeUtils:S,RangeEnumerator:ag,LinkFormatter:aS,LinkFormatFinder:H,LinkCommand:Y,UnlinkCommand:al,InlineFormatter:b,GreedyInlineFormatter:E,InlineFormatFinder:i,GreedyInlineFormatFinder:aV,BlockFormatter:U,GreedyBlockFormatter:aq,BlockFormatFinder:x,FormatCommand:aF,IndentFormatter:aQ,IndentCommand:o,OutdentCommand:Q,ListFormatFinder:am,ListFormatter:I,ListCommand:aw,ParagraphCommand:aN,NewLineCommand:d,ImageCommand:aJ,InsertHtmlCommand:aM,GenericCommand:aR,UndoRedoStack:P,TypingHandler:aK,SystemHandler:z,Keyboard:aE,MSWordFormatCleaner:f});ao.editor.prototype={value:function(aW){if(aW===undefined){return B(this.body)}aW=aW.replace(//g,"");aW=aW.replace(/]*)>(.*)?<\/script>/ig,"$2");if(s.browser.msie){aW="
"+aW;aW=aW.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,'originalhref="$1"');aW=aW.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,'originalsrc="$1"');this.body.innerHTML=aW;C.remove(this.body.firstChild);s("script,link,img,a",this.body).each(function(){if(this["originalhref"]){this.setAttribute("href",this["originalhref"]);this.removeAttribute("originalhref")}if(this["originalsrc"]){this.setAttribute("src",this["originalsrc"]);this.removeAttribute("originalsrc")}})}else{this.body.innerHTML=aW}this.update()},focus:function(){this.window.focus()},update:function(aW){this.textarea.value=aW||this.encoded?this.encodedValue():this.value()},encodedValue:function(){return C.encode(this.value())},createRange:function(aW){return aL(aW||this.document)},getSelection:function(){return aU(this.document)},selectRange:function(aX){var aW=this.getSelection();aW.removeAllRanges();aW.addRange(aX)},getRange:function(){var aW=this.getSelection();return aW.rangeCount>0?aW.getRangeAt(0):this.createRange()},selectedHtml:function(){return B(this.getRange().cloneContents())},paste:function(aW){this.clipboard.paste(aW)},exec:function(aZ,aW){aZ=aZ.toLowerCase();var a1="";for(var aY in this.tools){if(aY.toLowerCase()==aZ){a1=this.tools[aY];break}}if(a1){var aX=this.getRange();var a0=a1.command?a1.command(s.extend({range:aX},aW)):null;ao.trigger(this.element,"execute",{name:aZ,command:a0});if(/undo|redo/i.test(aZ)){this.undoRedoStack[aZ]()}else{if(a0){if(!a0.managesUndoRedo){this.undoRedoStack.push(a0)}a0.editor=this;a0.exec();if(a0.async){a0.change=s.proxy(function(){T(this)},this);return}}}T(this)}}};s.fn.tEditor=function(aW){return ao.create(this,{name:"tEditor",init:function(aX,aY){return new ao.editor(aX,aY)},options:aW})};var ah={bold:[{tags:["strong"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}],italic:[{tags:["em"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}],underline:[{tags:["span"],attr:{style:{textDecoration:"underline"}}}],strikethrough:[{tags:["del"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}],justifyLeft:[{tags:G,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left"}}}],justifyCenter:[{tags:G,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto"}}}],justifyRight:[{tags:G,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right"}}}],justifyFull:[{tags:G,attr:{style:{textAlign:"justify"}}}]};function ab(aY,aX){for(var aW=0;aW=0){return aX[aW]}}}function V(aW){s.extend(this,aW);this.init=function(aX,aY){aX.attr({unselectable:"on",title:aY.title})};this.command=function(aX){return new aW.command(aX)};this.update=function(){}}V.exec=function(aX,aY,aW){aX.focus();if(aX.selectionRestorePoint){aX.selectRange(aX.selectionRestorePoint.toRange())}aX.exec(aY,{value:aW})};function af(aW){V.call(this,aW);this.command=function(aX){return new aF(s.extend(aX,{formatter:aW.formatter}))};this.update=function(aX,aY){aX.toggleClass("t-state-active",aW.finder.isFormatted(aY))}}var O=function(){return{isFormatted:function(){return false}}};s.fn.tEditor.defaults={localization:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",fontName:"Select font family",fontSize:"Select font size",formatBlock:"Format",style:"Styles"},formats:ah,encoded:true,stylesheets:[],dialogOptions:{modal:true,resizable:false,draggable:true,effects:{list:[{name:"toggle"}]}},fontName:[{Text:"inherit",Value:"inherit"},{Text:"Arial",Value:"Arial,Helvetica,sans-serif"},{Text:"Courier New",Value:"'Courier New',Courier,monospace"},{Text:"Georgia",Value:"Georgia,serif"},{Text:"Impact",Value:"Impact,Charcoal,sans-serif"},{Text:"Lucida Console",Value:"'Lucida Console',Monaco,monospace"},{Text:"Tahoma",Value:"Tahoma,Geneva,sans-serif"},{Text:"Times New Roman",Value:"'Times New Roman',Times,serif"},{Text:"Trebuchet MS",Value:"'Trebuchet MS',Helvetica,sans-serif"},{Text:"Verdana",Value:"Verdana,Geneva,sans-serif"}],fontSize:[{Text:"inherit",Value:"inherit"},{Text:"1 (8pt)",Value:"xx-small"},{Text:"2 (10pt)",Value:"x-small"},{Text:"3 (12pt)",Value:"small"},{Text:"4 (14pt)",Value:"medium"},{Text:"5 (18pt)",Value:"large"},{Text:"6 (24pt)",Value:"x-large"},{Text:"7 (36pt)",Value:"xx-large"}],formatBlock:[{Text:"Paragraph",Value:"p"},{Text:"Quotation",Value:"blockquote"},{Text:"Heading 1",Value:"h1"},{Text:"Heading 2",Value:"h2"},{Text:"Heading 3",Value:"h3"},{Text:"Heading 4",Value:"h4"},{Text:"Heading 5",Value:"h5"},{Text:"Heading 6",Value:"h6"}],tools:{bold:new W({key:"B",ctrl:true,format:ah.bold}),italic:new W({key:"I",ctrl:true,format:ah.italic}),underline:new W({key:"U",ctrl:true,format:ah.underline}),strikethrough:new W({format:ah.strikethrough}),undo:{key:"Z",ctrl:true},redo:{key:"Y",ctrl:true},insertLineBreak:new V({key:13,shift:true,command:d}),insertParagraph:new V({key:13,command:aN}),justifyCenter:new N({format:ah.justifyCenter}),justifyLeft:new N({format:ah.justifyLeft}),justifyRight:new N({format:ah.justifyRight}),justifyFull:new N({format:ah.justifyFull}),insertUnorderedList:new aI({tag:"ul"}),insertOrderedList:new aI({tag:"ol"}),createLink:new V({key:"K",ctrl:true,command:Y}),unlink:new aO({key:"K",ctrl:true,shift:true}),insertImage:new V({command:aJ}),indent:new V({command:o}),outdent:new ad(),insertHtml:new w(),style:new Z(),fontName:new aA({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName"}),fontSize:new aA({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize"}),formatBlock:new n(),foreColor:new aT({cssAttr:"color",domAttr:"color",name:"foreColor"}),backColor:new aT({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor"})}}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.editing.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.editing.min.js new file mode 100644 index 000000000..b8056a536 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.editing.min.js @@ -0,0 +1 @@ +(function(h){var l=h.telerik;h.validator.addMethod("regex",function(o,q,p){if(this.optional(q)){return true}var r=new RegExp(p).exec(o);return r&&r.index==0&&r[0].length==o.length});h.validator.addMethod("number",function(o,r){var p=l.cultureInfo.numericgroupsize;var q=new l.stringBuilder();q.cat("^-?(?:\\d+|\\d{1,").cat(p).cat("}(?:").cat(l.cultureInfo.numericgroupseparator).cat("\\d{").cat(p).cat("})+)(?:\\").cat(l.cultureInfo.numericdecimalseparator).cat("\\d+)?$");return this.optional(r)||new RegExp(q.string()).test(o)});function b(p,o,q){p.range=[o,q]}function j(o,p){o.regex=p}function c(o){o.required=true}function m(o,p){o.maxlength=p}function e(o,p,q){o[p]=q}function g(r){var o={};for(var q=0;q",{id:q.element.id+"PopUp"}).appendTo(q.element).css({top:0,left:"50%",marginLeft:-90}).tWindow(q.settings).delegate(".t-grid-cancel","click",l.stopAll(function(){o.data("tWindow").close()}))}h.each(["insert","update"],function(r,s){if(q[s]){o.undelegate(".t-grid-"+s,"click").delegate(".t-grid-"+s,"click",l.stopAll(function(t){q[s](t.target,o)}))}});o.find("> .t-content").empty().append(q.content);var p=o.data("tWindow");p.title(q.title);p.open();return o}l.editing.implementation={insertRow:function(o){var p=this.extractValues(o);if(l.trigger(this.element,"save",{mode:"insert",values:p,form:o.find("form")[0]})){return}this.sendValues(p,"insertUrl")},updateRow:function(o){var p=this.dataItem(o.data("tr")||o);var q=this.extractValues(o,true);if(l.trigger(this.element,"save",{mode:"edit",dataItem:p,values:q,form:o.find("form")[0]})){return}this.sendValues(q,"updateUrl")},deleteRow:function(o){if(l.trigger(this.element,"delete",{dataItem:this.dataItem(o)})){return}if(this.editing.confirmDelete===false||confirm(this.localization.deleteConfirmation)){this.sendValues(this.extractValues(o,true),"deleteUrl")}},editRow:function(q){this.cancel();var r=new l.stringBuilder();var s=a(this.columns,"edit");this.form(r,[{name:"update",attr:s.attr,buttonType:s.buttonType,imageAttr:s.imageAttr},{name:"cancel",attr:s.attr,buttonType:s.buttonType,imageAttr:s.imageAttr}],q.find(".t-hierarchy-cell").find(".t-icon").hasClass("t-plus"));var p=this.dataItem(q);var o=h(r.string());o.children().hide();var t=o.find("tr:first td:not(.t-group-cell, .t-hierarchy-cell)");var u=this.editing.mode;if(u!="PopUp"){q.html(o)}else{f({title:this.localization.edit,element:this.element,settings:this.editing.popup,content:o,update:h.proxy(function(w,v){this.save(w,h.proxy(function(){v.data("tr",q);this.updateRow(v);v.data("tWindow").close()},this))},this)})}h.each(this.columns,function(v){if(this.edit){o.find(':input[name$="'+this.member+'"]').val(this.edit(p)+"").parent().filter(".t-numerictextbox").each(h.proxy(function(x,w){h(w).data("tTextBox").value(this.edit(p))},this)).end().find(':checkbox[name$="'+this.member+'"]').attr("checked",this.edit(p)==true)}if(u=="InLine"&&this.readonly){t.eq(v).html(this.display(p))}});o.children().show();l.trigger(this.element,"edit",{mode:"edit",form:o.find("form")[0]||o[0],dataItem:p});this.validation()},addRow:function(){this.cancel();var r=new l.stringBuilder();var p=this.editing.mode;var q=a(this.columns,"edit");var o;if(p!="PopUp"){r.cat('');this.form(r,[{name:"insert",attr:q.attr,buttonType:q.buttonType,imageAttr:q.imageAttr},{name:"cancel",attr:q.attr,buttonType:q.buttonType,imageAttr:q.imageAttr}]);r.cat("");o=h(r.string()).prependTo(this.$tbody)}else{this.form(r,[{name:"insert",attr:q.attr,buttonType:q.buttonType,imageAttr:q.imageAttr},{name:"cancel",attr:q.attr,buttonType:q.buttonType,imageAttr:q.imageAttr}]);o=h(r.string());f({title:this.localization.insert,element:this.element,settings:this.editing.popup,content:o,insert:h.proxy(function(t,s){this.save(t,h.proxy(function(){this.insertRow(s);s.data("tWindow").close()},this))},this)})}l.trigger(this.element,"edit",{mode:"insert",form:o.find("form")[0]||o[0]});this.validation()},extractValues:function(o,r){var s={};h.each(this.columns,function(){var t=this.member;if(this.edit){o.find(':input[name$="'+t+'"]').each(function(){s[t]=h(this).val()}).end().find(':checkbox[name$="'+t+'"]').each(function(){s[t]=h(this).attr("checked")})}});if(r){var q=this.dataItem(o.data("tr")||o);for(var p in this.dataKeys){s[this.ws?p:this.dataKeys[p]]=this.valueFor({member:p})(q)}}return s},cancelRow:function(o){if(!o.length){return}if(o.is(".t-grid-new-row")){o.remove();return}var q=this.dataItem(o);var r=new l.stringBuilder();var p=o.find(".t-hierarchy-cell").find(".t-icon").hasClass("t-plus");r.rep('',this.groups.length).catIf('',this.detail);h.each(this.columns,h.proxy(function(s,t){r.cat("");if(t.display){r.cat(t.display(q))}this.appendCommandHtml(t.commands,r);r.cat("")},this));o.html(r.string());l.trigger(this.element,"rowDataBound",{row:o[0],dataItem:q})},form:function(r,o,s){var p=this.$tbody.siblings("colgroup");var t=this.editing.mode;if(t!="PopUp"){r.cat('')}r.cat('
');if(t=="InLine"){r.cat('');this.$tbody.siblings("colgroup").children().each(function(){var u=h(this).css("width");if(u!="0px"){r.cat('')}else{r.cat("")}});var q=new l.stringBuilder();q.cat('");r.cat("").rep('")},this));r.cat("
').catIf('',s!=undefined).cat("
',this.groups.length).catIf(q.string(),this.detail);h.each(this.columns,h.proxy(function(u,v){r.cat("").catIf(v.editor,v.editor).catIf(" ",!v.editor&&!v.commands);if(v.commands){this.appendCommandHtml(o,r)}r.cat("
")}else{r.cat('
').cat(this.editing.editor).cat("
");h.each(this.columns,h.proxy(function(u,v){if(v.commands){this.appendCommandHtml(o,r)}},this));r.cat("
")}r.cat("
");r.catIf("",t!="PopUp")},save:function(o,p){h(o).closest("form").validate().form()&&p()},cancel:function(){this.cancelRow(h("#"+this.formId()).closest("tr"))},sendValues:function(s,o){if(this.ws){for(var p in s){var r=this.columnFromMember(p);if(r&&r.type=="Date"){var q=l.datetime.parse(s[p],l.cultureInfo.shortDate).toDate();s[p]="\\/Date("+q.getTime()+")\\/"}}}h.ajax(this.ajaxOptions({data:this.ws?{value:s}:s,url:this.url(o)}))},formId:function(){return h(this.element).attr("id")+"form"},validation:function(){if(window.mvcClientValidationMetadata){var o=this.formId();var p=h.grep(window.mvcClientValidationMetadata,function(q){return q.FormId==o})[0];if(p){p.Fields=h.grep(p.Fields,h.proxy(function(q){var r=this.columnFromMember(q.FieldName);return !r||r.type!="Boolean"},this));i(p)}}}}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.filtering.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.filtering.min.js new file mode 100644 index 000000000..6600af174 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.filtering.min.js @@ -0,0 +1 @@ +(function(c){var b=c.telerik;var e=/'/ig;var d=b.fx.slide.defaults();function f(g){if(!g.format){return b.cultureInfo.shortDate}return/\{0(:([^\}]+))?\}/.exec(g.format)[2]}function a(h,g){if(h.type=="Date"){return b.formatString(h.format||"{0:G}",new Date(parseInt(g.replace(/\/Date\((.*?)\)\//,"$1"))))}return g}b.filtering={};b.filtering.initialize=function(g){c.extend(g,b.filtering.implementation);g.filterBy=g.filterExpr();c("> .t-grid-content",g.element).bind("scroll",function(){g.hideFilter()});c(document).click(function(h){if(h.which!=3){g.hideFilter()}});g.$header.find(".t-grid-filter").click(c.proxy(g.showFilter,g)).hover(function(){c(this).toggleClass("t-state-hover")})};b.filtering.implementation={createFilterCommands:function(h,g){var i={};c.each(this.localization,function(m,j){var k="filter"+g.type;var l=m.indexOf(k);if(l>-1){i[m.substring(l+k.length).toLowerCase()]=j}});h.cat('")},createTypeSpecificInput:function(j,g,h,i){if(g.type=="Date"){j.cat('
').cat('').cat('
')}else{if(g.type=="Boolean"){j.cat('
').cat('
")}else{if(g.type=="Enum"){j.cat("
")}else{if(g.type=="Number"){j.cat('
').cat('').cat("
")}else{j.cat('')}}}}},createFilterMenu:function(g){var j=new b.stringBuilder();j.cat('
");var i=c(j.string());c.each(g.filters||[],function(k){i.find(".t-filter-operator:eq("+k+")").val(this.operator).end().find(":text:eq("+k+"),select:not(.t-filter-operator):eq("+k+")").val(a(g,this.value));if(g.type=="Boolean"){i.find(":radio[id$="+this.value+"]").attr("checked",true)}});return i.find(".t-datepicker").each(function(){c(this).tDatePicker({format:f(g)})}).end().find(".t-numerictextbox").each(function(){c(this).tTextBox({type:"numeric",minValue:null,maxValue:null,numFormat:"",groupSeparator:""})}).end().appendTo(this.element)},showFilter:function(m){m.stopPropagation();var g=c(m.target).closest(".t-grid-filter");this.hideFilter(function(){return this.parentNode!=g[0]});var k=g.data("filter");if(!k){var h=this.columns[this.$columns().index(g.parent())];k=this.createFilterMenu(h).data("column",h).click(function(p){p.stopPropagation();if(c(p.target).parents(".t-datepicker").length==0){c(".t-datepicker",this).each(function(){c(this).data("tDatePicker").hidePopup()})}}).find(".t-filter-button").click(c.proxy(this.filterClick,this)).end().find(".t-clear-button").click(c.proxy(this.clearClick,this)).end().find("input[type=text]").keyup(c.proxy(function(p){if(p.keyCode==13){this.filterClick(p)}},this)).end();g.data("filter",k)}var l=0;c(this.element).find("> .t-grouping-header, > .t-grid-toolbar").add(this.$header).each(function(){l+=this.offsetHeight});var i={top:l};var n=-this.$headerWrap.scrollLeft()-1;g.parent().add(g.parent().prevAll("th")).each(function(){if(c(this).css("display")!="none"){n+=this.offsetWidth}});var j=n-g.outerWidth();var o=k.outerWidth()||k.find(".t-group").outerWidth();if(j+o>this.$header.outerWidth()){j=n-o+1}if(c(this.element).hasClass("t-grid-rtl")){i.right=j+(c.browser.mozilla||c.browser.safari?18:0)}else{i.left=j}k.css(i);b.fx[k.find(".t-filter-options").is(":visible")?"rewind":"play"](d,k.find(".t-filter-options"),{direction:"bottom"})},hideFilter:function(g){g=g||function(){return true};c(".t-grid .t-animation-container").find(".t-datepicker").each(function(){c(this).data("tDatePicker").hidePopup()}).end().find(".t-filter-options").filter(g).each(function(){b.fx.rewind(d,c(this),{direction:"bottom"})})},clearClick:function(i){i.preventDefault();var h=c(i.target);var g=h.closest(".t-animation-container").data("column");g.filters=null;h.parent().find("input, select").removeAttr("checked").removeClass("t-state-error").not(":radio").val("");this.filter(this.filterExpr())},filterClick:function(j){j.preventDefault();var i=c(j.target);var g=i.closest(".t-animation-container").data("column");g.filters=[];var h=false;i.parent().find("input[type=text]:visible,select:not(.t-filter-operator)").each(c.proxy(function(p,n){var l=c(n);var k=c.trim(l.val());if(!k){l.removeClass("t-state-error");return true}var m=this.isValidFilterValue(g,k);l.toggleClass("t-state-error",!m);if(!m){h=true;return true}var o=l.prev("select").val()||l.parent().prev("select").val();if(k!=this.localization.filterSelectValue){g.filters.push({operator:o,value:k})}},this));i.parent().find("input:checked").each(c.proxy(function(m,l){var n=c(l);var k=c(l).attr("value");g.filters.push({operator:"eq",value:k})},this));if(!h){if(g.filters.length>0){this.filter(this.filterExpr())}this.hideFilter()}},isValidFilterValue:function(h,g){if(h.type=="Number"){return !isNaN(g)}return true},encodeFilterValue:function(g,h){switch(g.type){case"String":return"'"+h.replace(e,"''")+"'";case"Date":var i;if(h.indexOf("Date(")>-1){i=new Date(parseInt(h.replace(/^\/Date\((.*?)\)\/$/,"$1")))}else{i=b.datetime.parse(h,f(g)).toDate()}return"datetime'"+b.formatString("{0:yyyy-MM-ddTHH-mm-ss}",i)+"'"}return h},filterExpr:function(){var g=[];c.each(this.columns,c.proxy(function(h,i){if(i.filters){c.each(i.filters,c.proxy(function(m,k){var j=new b.stringBuilder();var l=this.encodeFilterValue(i,k.value);if(/startswith|substringof|endswith/.test(k.operator)){j.cat(k.operator).cat("(").cat(i.member).cat(",").cat(l).cat(")")}else{j.cat(i.member).cat("~").cat(k.operator).cat("~").cat(l)}g.push(j.string())},this))}},this));return g.join("~and~")},filter:function(g){this.currentPage=1;this.filterBy=g;if(this.isAjax()){this.$columns().each(c.proxy(function(i,h){c(".t-grid-filter",h).toggleClass("t-active-filter",!!this.columns[i].filters)},this));this.ajaxRequest()}else{this.serverRequest()}}}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.grouping.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.grouping.min.js new file mode 100644 index 000000000..d0d55b828 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.grouping.min.js @@ -0,0 +1 @@ +(function(d){var b=d.telerik;var c=3;var a=0;b.grouping={};b.grouping.initialize=function(e){d.extend(e,b.grouping.implementation);e.$groupDropClue=d('
');e.$groupHeader=d("> .t-grouping-header",e.element);b.draganddrop(e.element.id,d.extend({useDragClue:true,draggables:[d(".t-link",e.$groupHeader[0]),d(".t-header:not(.t-group-cell,.t-hierarchy-cell)",e.$header[0])]},b.draganddrop.applyContext(b.draganddrop.grouping,e)));if(e.isAjax()){e.$groupHeader.delegate(".t-button","click",function(f){f.preventDefault();e.unGroup(d(this).parent().text())}).delegate(".t-link","click",function(g){g.preventDefault();var f=e.groupFromTitle(d(this).parent().text());f.order=f.order=="asc"?"desc":"asc";e.group(f.title)})}e.$groupHeader.delegate(".t-group-indicator","mouseenter",function(){e.$currentGroupItem=d(this)}).delegate(".t-group-indicator","mouseleave",function(){e.$currentGroupItem=null});e.$tbody.delegate(".t-grouping-row .t-collapse, .t-grouping-row .t-expand","click",b.stop(function(g){g.preventDefault();var f=d(this).closest("tr");if(d(this).hasClass("t-collapse")){e.collapseGroup(f)}else{e.expandGroup(f)}}))};b.grouping.implementation={columnFromTitle:function(e){return d.grep(this.columns,function(f){return f.title==e})[0]},groupFromTitle:function(e){return d.grep(this.groups,function(f){return f.title==e})[0]},expandGroup:function(f){var g=d(f);var e=g.find(".t-group-cell").length;g.find("~ tr").each(d.proxy(function(j,k){var h=d(k);var l=h.find(".t-group-cell").length;if(l<=e){return false}if(l==e+1&&!h.hasClass("t-detail-row")){h.show();if(h.hasClass("t-grouping-row")&&h.find(".t-icon").hasClass("t-collapse")){this.expandGroup(h)}if(h.hasClass("t-master-row")&&h.find(".t-icon").hasClass("t-minus")){h.next().show()}}},this));g.find(".t-icon").addClass("t-collapse").removeClass("t-expand")},collapseGroup:function(f){var g=d(f);var e=g.find(".t-group-cell").length;g.find("~ tr").each(function(){var h=d(this);var i=h.find(".t-group-cell").length;if(i<=e){return false}h.hide()});g.find(".t-icon").addClass("t-expand").removeClass("t-collapse")},group:function(f,i){if(this.groups.length==0&&this.isAjax()){this.$groupHeader.empty()}var g=d.grep(this.groups,function(k){return k.title==f})[0];if(!g){var h=this.columnFromTitle(f);g={order:"asc",member:h.member,title:f};this.groups.push(g)}if(i>=0){this.groups.splice(d.inArray(g,this.groups),1);this.groups.splice(i,0,g)}this.groupBy=d.map(this.groups,function(k){return k.member+"-"+k.order}).join("~");if(this.isAjax()){var j=this.$groupHeader.find('div:contains("'+f+'")');if(j.length==0){var e=new d.telerik.stringBuilder().cat('
').cat('').cat(f).cat("").cat('').cat("
").string();j=d(e).appendTo(this.$groupHeader)}if(this.$groupDropClue.is(":visible")){j.insertBefore(this.$groupDropClue)}j.find(".t-link .t-icon").toggleClass("t-arrow-up-small",g.order=="asc").toggleClass("t-arrow-down-small",g.order=="desc");this.ajaxRequest()}else{this.serverRequest()}},unGroup:function(f){var e=this.groupFromTitle(f);this.groups.splice(d.inArray(e,this.groups),1);if(this.groups.length==0){this.$groupHeader.html(this.localization.groupHint)}this.groupBy=d.map(this.groups,function(h){return h.member+"-"+h.order}).join("~");if(this.isAjax()){this.$groupHeader.find('div:contains("'+e.title+'")').remove();this.ajaxRequest()}else{this.serverRequest()}},normalizeColumns:function(g){var h=this.groups.length;var f=g-this.$tbody.parent().find("col").length;if(f==0){return}var i=this.$tbody.parent().add(this.$headerWrap.find("table"));if(d.browser.msie){if(f>0){d(new b.stringBuilder().rep('',f).string()).prependTo(i.find("colgroup"));d(new b.stringBuilder().rep(' ',f).string()).insertBefore(i.find("th.t-header:first"))}else{i.find("th:lt("+Math.abs(f)+")").remove().end().find("col:lt("+Math.abs(f)+")").remove()}if(document.documentMode==8){if(this.scrollable){i.css("table-layout","auto")}var j=this;var e=30;i.find("col").css("width",function(){return d(this).is(".t-group-col,.t-hierarchy-col")?e:(d(j.element).width()-h*e-16)/j.columns.length})}}else{i.find("col.t-group-col").remove();d(new b.stringBuilder().rep('',h).string()).prependTo(i.find("colgroup"));i.find("th.t-group-cell").remove();d(new b.stringBuilder().rep(' ',h).string()).insertBefore(i.find("th.t-header:first"))}this.$footer.attr("colspan",g)},bindGroup:function(g,m,k,j){var h=this.groups[j];var o=g.Key;var f=d.grep(this.columns,function(i){return h.member==i.member})[0];if(f&&(f.format||f.type=="Date")){o=b.formatString(f.format||"{0:G}",o)}k.cat('').rep('',j).cat('

').cat(h.title).cat(": ").cat(o).cat("

");if(g.HasSubgroups){for(var e=0,n=g.Items.length;e .t-grid-toolbar",this.element).outerHeight()+c;if(!i.length){this.$groupDropClue.css({top:l,left:a}).appendTo(this.$groupHeader);return"t-add"}var g=i[0];var n=i[i.length-1];var h=parseInt(g.$group.css("marginLeft"));var j=parseInt(g.$group.css("marginRight"));var k=d.grep(i,function(e){return m.pageX>=e.left-h-j&&m.pageX<=e.right})[0];if(!k&&g&&m.pageX0){var i=this.$groupHeader.find("div").index(this.$groupDropClue);var l=j-i;if(!g||(this.$groupDropClue.is(":visible")&&l!=0&&l!=-1)){this.group(h,i)}}else{if(f.parent().is(".t-group-indicator")){this.unGroup(h)}else{this.$groupDropClue.remove();return false}}this.$groupDropClue.remove();return true}}})})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.min.js new file mode 100644 index 000000000..1755a9e9b --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.min.js @@ -0,0 +1 @@ +(function(d){var a=d.telerik;var b=/"\\\/Date\((.*?)\)\\\/"/g;function c(e){return new Function("data",("var p=[];with(data){p.push('"+unescape(e).replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');"))}a.grid=function(f,g){this.element=f;this.groups=[];this.editing={};this.filterBy="";this.groupBy="";this.orderBy="";d.extend(this,g);this.sorted=d.grep(this.columns,function(i){return i.order});this.$tbody=d("> .t-grid-content > table tbody",f);this.scrollable=this.$tbody.length>0;if(!this.scrollable){this.$tbody=d("> table > tbody",f);this.$header=d("> table > thead tr",f);this.$footer=d("> table > tfoot .t-pager-wrapper",f)}else{this.$header=d("> .t-grid-header tr",f);this.$footer=d("> .t-grid-footer",f)}var l=this.$headerWrap=d("> .t-grid-header > .t-grid-header-wrap",f);d("> .t-grid-content",f).bind("scroll",function(){l.scrollLeft(this.scrollLeft)});this.$tbody.delegate(".t-hierarchy-cell .t-plus, .t-hierarchy-cell .t-minus","click",a.stopAll(function(o){var n=d(o.target);var m=n.hasClass("t-plus");n.toggleClass("t-minus",m).toggleClass("t-plus",!m);var i=n.closest("tr.t-master-row");if(this.detail&&!i.next().hasClass("t-detail-row")){d(new a.stringBuilder().cat('').rep('',i.find(".t-group-cell").length).cat('').cat('').cat(this.displayDetails(this.dataItem(i))).cat("").string()).insertAfter(i)}a.trigger(this.element,m?"detailViewExpand":"detailViewCollapse",{masterRow:i[0],detailRow:i.next(".t-detail-row")[0]});i.next().toggle(m)},this));this.$pager=d("> .t-pager-wrapper .t-pager",f).add(this.$footer.find(".t-pager"));this.$pager.delegate(".t-state-disabled","click",a.preventDefault).delegate(".t-link:not(.t-state-disabled)","hover",function(){d(this).toggleClass("t-state-hover")}).delegate("input[type=text]","keydown",d.proxy(this.pagerKeyDown,this));this.$footer.add(d("> .t-pager-wrapper",f)).delegate(".t-refresh","click",d.proxy(this.refreshClick,this));d(f).delegate(".t-button","hover",a.stop(function(){d(this).toggleClass("t-button-hover")}));if(this.sort){this.$header.delegate(".t-link","hover",function(){d(this).toggleClass("t-state-hover")})}var e="tr:not(.t-grouping-row,.t-detail-row)";if(this.selectable){var k=this.$tbody[0];var j=this;this.$tbody.delegate(e,"click",function(i){if(this.parentNode==k){j.rowClick(i)}}).delegate(e,"hover",function(){if(this.parentNode==k){d(this).toggleClass("t-state-hover")}})}if(this.isAjax()){this.$pager.delegate(".t-link:not(.t-state-disabled)","click",a.stop(this.pagerClick,this));if(this.sort){this.$header.delegate(".t-link","click",a.stop(this.headerClick,this))}}for(var h=0;h tr:not(.t-grouping-row,.t-detail-row)")},expandRow:function(e){d(e).find("> td .t-plus, > td .t-expand").click()},collapseRow:function(e){d(e).find("> td .t-minus, > td .t-collapse").click()},headerClick:function(f){f.preventDefault();this.toggleOrder(this.$columns().index(d(f.target).closest("th")));this.sort(this.sortExpr())},refreshClick:function(g,f){if(d(f).is(".t-loading")){return}if(this.isAjax()){g.preventDefault();this.ajaxRequest(true)}},sort:function(e){this.orderBy=e;this.ajaxRequest()},columnFromMember:function(e){var f=d.grep(this.columns,function(g){return g.member==e})[0];if(!f){f=d.grep(this.columns,function(h){var g="."+h.member;return e.substr(e.length-g.length)==g})[0]}return f},toggleOrder:function(e){e=typeof e=="number"?this.columns[e]:e;var g="asc";if(e.order=="asc"){g="desc"}else{if(e.order=="desc"){g=null}}e.order=g;var f=d.inArray(e,this.sorted);if(this.sortMode=="single"&&f<0){d.each(this.sorted,function(){this.order=null});this.sorted=[]}if(f<0&&g){this.sorted.push(e)}if(!g){this.sorted.splice(f,1)}},sortExpr:function(){return d.map(this.sorted,function(e){return e.member+"-"+e.order}).join("~")},pagerKeyDown:function(f){if(f.keyCode==13){var g=this.sanitizePage(d(f.target).val());if(g!=this.currentPage){this.pageTo(g)}else{d(element).val(g)}}},isAjax:function(){return this.ajax||this.ws||this.onDataBinding},url:function(e){return(this.ajax||this.ws)[e]},pagerClick:function(k){k.preventDefault();var g=d(k.target).closest(".t-link");var h=this.currentPage;var i=g.find(".t-icon");if(i.hasClass("t-arrow-next")){h++}else{if(i.hasClass("t-arrow-last")){h=this.totalPages()}else{if(i.hasClass("t-arrow-prev")){h--}else{if(i.hasClass("t-arrow-first")){h=1}else{var f=g.text();if(f=="..."){var j=g.parent().children().index(g);if(j==0){h=parseInt(g.next().text())-1}else{h=parseInt(g.prev().text())+1}}else{h=parseInt(f)}}}}}this.pageTo(h)},pageTo:function(e){this.currentPage=e;if(this.isAjax()){this.ajaxRequest()}else{this.serverRequest()}},ajaxOptions:function(f){var e={type:"POST",dataType:"text",dataFilter:function(h,i){return h.replace(b,"new Date($1)")},error:d.proxy(function(i,h){if(a.ajaxError(this.element,"error",i,h)){return}},this),complete:d.proxy(this.hideBusy,this),success:d.proxy(function(i,j,h){try{i=eval("("+i+")")}catch(k){if(!a.ajaxError(this.element,"error",h,"parseeror")){alert("Error! The requested URL did not return JSON.")}return}i=i.d||i;this.total=i.total||i.Total||0;this.dataBind(i.data||i.Data)},this)};d.extend(e,f);var g=this.ws?e.data.state={}:e.data;g[this.queryString.page]=this.currentPage;g[this.queryString.size]=this.pageSize;g[this.queryString.orderBy]=this.orderBy||"";g[this.queryString.groupBy]=this.groupBy;g[this.queryString.filter]=(this.filterBy||"").replace(/\"/g,'\\"');if(this.ws){e.data=a.toJson(e.data);e.contentType="application/json; charset=utf-8"}return e},showBusy:function(){this.busyTimeout=setTimeout(d.proxy(function(){this.$footer.find(".t-status .t-icon").addClass("t-loading")},this),100)},hideBusy:function(){clearTimeout(this.busyTimeout);this.$footer.find(".t-status .t-icon").removeClass("t-loading")},serverRequest:function(){location.href=a.formatString(unescape(this.urlFormat),this.currentPage,this.orderBy||"~",this.groupBy||"~",encodeURIComponent(this.filterBy)||"~")},ajaxRequest:function(){var f={page:this.currentPage,sortedColumns:this.sorted,filteredColumns:d.grep(this.columns,function(e){return e.filters})};if(a.trigger(this.element,"dataBinding",f)){return}if(!this.ajax&&!this.ws){return}this.showBusy();d.ajax(this.ajaxOptions({data:d.extend({},f.data),url:this.url("selectUrl")}))},valueFor:function(e){if(e.type=="Date"){return new Function("data","var value = data."+e.member+'; if (!value) return null; return value instanceof Date? value : new Date(parseInt(value.replace(/\\/Date\\((.*?)\\)\\//, "$1")));')}return new Function("data","return data."+e.member+";")},displayFor:function(e){if(!e.template){if(e.format||e.type=="Date"){return function(f){var g=e.value(f);return g==null?"":a.formatString(e.format||"{0:G}",g)}}return e.value}return c(e.template)},createColumnMappings:function(){d.each(this.columns,d.proxy(function(e,f){if(f.member){f.value=this.valueFor(f);f.display=this.displayFor(f);f.edit=f.type!="Date"?f.value:f.display}else{if(f.template){f.display=this.displayFor(f);f.readonly=true}}},this));if(this.detail){this.displayDetails=c(this.detail.template)}},bindData:function(f,j,l){Array.prototype.push.apply(this.data,f);var n=Math.min(this.pageSize,f.length);n=this.pageSize?n:f.length;if(d.browser.msie){d(this.element).find(".t-grid-content colgroup:first col").css("display","")}for(var o=0;o')}else{j.cat("")}j.rep('',l).catIf('',this.detail);for(var g=0,k=this.columns.length;g");var h=m.display;if(h){j.cat(h(f[o]))}this.appendCommandHtml(m.commands,j);j.cat("")}j.cat("")}},appendCommandHtml:function(g,h){if(g){var e=this.localization;var f=function(i,j){j.cat('")};d.each(g,function(){var j=h.cat('");var i=this.buttonType;if(i=="Image"){f(this,j)}else{if(i=="ImageAndText"){f(this,j);j.cat(e[this.name])}else{j.cat(e[this.name])}}j.cat("")})}},normalizeColumns:function(){},dataItem:function(e){return this.data[this.$tbody.find("> tr:not(.t-grouping-row,.t-detail-row)").index(d(e))]},bindTo:function(j){var g=new a.stringBuilder();if(j&&j.length){var h=this.groups.length+this.columns.length+(this.detail?1:0);this.normalizeColumns(h);if("HasSubgroups" in j[0]){for(var e=0,f=j.length;e=e).removeClass("t-state-hover");this.$pager.find(".t-arrow-prev").parent().add(this.$pager.find(".t-arrow-first").parent()).toggleClass("t-state-disabled",g==1).removeClass("t-state-hover");var f=this.localization;this.$pager.find(".t-page-i-of-n").each(function(){this.innerHTML=new a.stringBuilder().cat(f.page).cat(' ').cat(a.formatString(f.pageOf,e)).string()});this.$pager.find(".t-numeric").each(d.proxy(function(i,h){this.numericPager(h,g,e)},this));this.$pager.parent().find(".t-status-text").text(a.formatString(f.displayingItems,this.firstItemInPage(),this.lastItemInPage(),this.total))},numericPager:function(f,l,m){var j=10;var h=1;if(l>j){var e=(l%j);h=(e==0)?(l-j)+1:(l-e)+1}var i=(h+j)-1;i=Math.min(i,m);var g=new a.stringBuilder();if(h>1){g.cat('...')}for(var k=h;k<=i;k++){if(k==l){g.cat('').cat(k).cat("")}else{g.cat('').cat(k).cat("")}}if(i...')}f.innerHTML=g.string()},$columns:function(){return this.$header.find("th:not(.t-hierarchy-cell,.t-group-cell)")},updateSorting:function(){this.sorted=[];d.each(this.orderBy.split("~"),d.proxy(function(f,e){var g=e.split("-");var h=this.columnFromMember(g[0]);if(h){h.order=g[1];this.sorted.push(h)}},this));this.$columns().each(d.proxy(function(f,j){var g=this.columns[f].order;var e=d(j).children(".t-link");var h=e.children(".t-icon");if(!g){h.hide()}else{if(h.length==0){h=d('').appendTo(e)}h.toggleClass("t-arrow-up",g=="asc").toggleClass("t-arrow-down",g=="desc").show()}},this))},sanitizePage:function(f){var e=parseInt(f,10);if(isNaN(e)||e<1){return 1}return Math.min(e,this.totalPages())},totalPages:function(){return Math.ceil(this.total/this.pageSize)},firstItemInPage:function(){return this.total>0?(this.currentPage-1)*this.pageSize+1:0},lastItemInPage:function(){return Math.min(this.currentPage*this.pageSize,this.total)},dataBind:function(e){this.data=[];this.bindTo(e);this.updatePager();this.updateSorting();a.trigger(this.element,"dataBound")},rebind:function(f){this.sorted=[];this.filterBy="";this.currentPage=1;d.each(this.columns,function(){this.order=null;this.filters=[]});d(".t-filter-options",this.element).find('input[type="text"], select').val("").removeClass("t-state-error");for(var h in f){var g=new RegExp(a.formatString("({0})=([^&]*)",h),"g");if(g.test(this.ajax.selectUrl)){this.ajax.selectUrl=this.ajax.selectUrl.replace(g,"$1="+f[h])}else{var e=new a.stringBuilder();e.cat(this.ajax.selectUrl);if(this.ajax.selectUrl.indexOf("?")<0){e.cat("?")}else{e.cat("&")}this.ajax.selectUrl=e.cat(h).cat("=").cat(f[h]).string()}}this.ajaxRequest()}};d.fn.tGrid=function(e){return a.create(this,{name:"tGrid",init:function(f,g){return new a.grid(f,g)},options:e,success:function(f){if(f.$tbody.find("tr.t-no-data").length){f.ajaxRequest()}}})};d.fn.tGrid.defaults={columns:[],plugins:[],currentPage:1,pageSize:10,localization:{addNew:"Add new record","delete":"Delete",cancel:"Cancel",insert:"Insert",update:"Update",select:"Select",pageOf:"of {0}",displayingItems:"Displaying items {0} - {1} of {2}",edit:"Edit",page:"Page ",filter:"Filter",filterClear:"Clear Filter",filterShowRows:"Show rows with value that",filterAnd:"And",filterStringEq:"Is equal to",filterStringNe:"Is not equal to",filterStringStartsWith:"Starts with",filterStringSubstringOf:"Contains",filterStringEndsWith:"Ends with",filterNumberEq:"Is equal to",filterNumberNe:"Is not equal to",filterNumberLt:"Is less than",filterNumberLe:"Is less than or equal to",filterNumberGt:"Is greater than",filterNumberGe:"Is greater than or equal to",filterDateEq:"Is equal to",filterDateNe:"Is not equal to",filterDateLt:"Is before",filterDateLe:"Is before or equal to",filterDateGt:"Is after",filterDateGe:"Is after or equal to",filterEnumEq:"Is equal to",filterEnumNe:"Is not equal to",filterBoolIsTrue:"is true",filterBoolIsFalse:"is false",filterSelectValue:"-Select value-",filterOpenPopupHint:"Open the calendar popup",groupHint:"Drag a column header and drop it here to group by that column",deleteConfirmation:"Are you sure you want to delete this record?"},queryString:{page:"page",size:"size",orderBy:"orderBy",groupBy:"groupBy",filter:"filter"}}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.resizing.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.resizing.min.js new file mode 100644 index 000000000..0e2bc576e --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.grid.resizing.min.js @@ -0,0 +1 @@ +(function(a){var b=a.telerik;b.resizing={};b.resizing.initialize=function(r){var d,p=a('
'),k,e,j,n=3;function o(s,t){a("th, th .t-grid-filter, th .t-link",s).add(document.body).css("cursor",t)}function m(s){var t=0;a(".t-grouping-header, .t-grid-toolbar",s).each(function(){t+=this.offsetHeight});return t}function g(v){var t=0;a(".t-resize-handle",r.element).each(function(){t+=a(this).data("th").outerWidth();a(this).css("left",t-n)});t=-r.$tbody.closest(".t-grid-content").scrollLeft();v.prevAll("th").add(v).each(function(){t+=this.offsetWidth});var s=r.scrollable?a(".t-grid-content",r.element):a("tbody",r.element);var u=s.attr(r.scrollable?"clientWidth":"offsetWidth");if(t>=u){p.remove()}else{p.css({left:t,top:m(r.element),height:v.outerHeight()+s.attr(r.scrollable?"clientHeight":"offsetHeight")});if(!p.parent().length){p.appendTo(r.element)}}}function q(s){return true}function i(t,u){var s=u.data("th");d=a("colgroup",r.element).find("col:eq("+s.index()+")");j=t.pageX;e=s.outerWidth();k=r.$tbody.outerWidth()}function l(t,u){var s=e+t.pageX-j;if(s>10){d.css("width",s);if(r.scrollable){r.$tbody.parent().add(r.$headerWrap.find("table")).css("width",k+t.pageX-j)}g(u.data("th"))}}function f(s,t){p.remove();o(r.element,"")}function c(v,w,t){f();var u=w.data("th");var s=u.outerWidth();if(r.onColumnResize&&s!=e){b.trigger(r.element,"columnResize",{column:r.columns[r.$columns().index(u)],oldWidth:e,newWidth:s})}return true}var h=0;a(".t-header",r.element).each(function(){h+=this.offsetWidth;var s=a(this);if(!s.hasClass("t-group-cell")){a('
').css({left:h-n,top:r.scrollable?0:m(r.element),width:n*2}).appendTo(r.scrollable?r.$headerWrap:r.element).data("th",s).mousedown(function(){g(s);o(r.element,a(this).css("cursor"))}).mouseup(function(){o(r.element,"")})}});b.draganddrop(r.element.id+"Resize",{draggables:a(".t-resize-handle",r.element),hitTestOffset:0,shouldDrag:q,onDragStart:i,onDragMove:l,onDragCancelled:f,onDrop:c})}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.list.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.list.min.js new file mode 100644 index 000000000..c3decd0c1 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.list.min.js @@ -0,0 +1 @@ +(function(c){var f=c.telerik;var b=parseInt(c.browser.version.substring(0,5).replace(".",""));var d=c.browser.mozilla&&b>=180&&b<=191;f.dropDown=function(i){c.extend(this,i);this.$element=c(new f.stringBuilder().cat("
    ').cat("
").string()).hide();var h=this.$element[0];if(!h.style.width){h.style.width=(i.outerWidth?i.outerWidth-2:0)+"px"}if(!h.style.overflowY){h.style.overflowY="auto"}function g(m){var k=new f.stringBuilder();if(m){for(var j=0,n=m.length;j').cat(o.html).cat("")}}return k.string()}this.position=function(k,j){this.offset={top:k,left:j}};this.open=function(){if(this.isOpened()||(this.onOpen&&!this.onOpen())){return}var m=this.$element;var k=".t-reset > .t-item";m.delegate(k,"mouseenter",f.hover).delegate(k,"mouseleave",f.leave).delegate(k,"click",c.proxy(function(n){if(this.onClick){this.onClick(c.extend(n,{item:c(n.target).closest(".t-item")[0]}))}},this)).appendTo(document.body);var l=this.offset;l.top+=this.outerHeight;var j=this.zIndex||"auto";if(c.browser.msie&&j=="auto"){j=""}f.fx._wrap(m).css(c.extend({position:"absolute",zIndex:j},this.offset));if(d){m.css("overflow","hidden")}f.fx.play(this.effects,m,{direction:"bottom"},c.proxy(function(){if(d){m.css("overflow","auto")}var n=this.$items.filter(".t-state-selected");if(n.length){this.scrollTo(n[0])}},this))};this.close=function(){if(this.onClose&&!this.onClose()){return}var j=this.$element;if(d){j.css("overflow","hidden")}f.fx.rewind(this.effects,j,{direction:"bottom"},function(){if(d){j.css("overflow","auto")}j.parent().remove()})};this.dataBind=function(k){k=k||[];var n=this.$element;var m=n[0].style.height;var l=m&&m!="auto"?n[0].style.height:"200px";var j=c(g.call(this,k));n.find("> ul").html(j);n.css("height",j.length>10?l:"auto");this.$items=j};this.highlight=function(j){return c(j).addClass("t-state-selected").siblings().removeClass("t-state-selected").end().index()};this.isOpened=function(){return this.$element.is(":visible")};this.scrollTo=function(p){if(!p){return}var j=p.offsetTop;var n=p.offsetHeight;var k=this.$element[0];var l=k.scrollTop;var o=k.clientHeight;var m=j+n;k.scrollTop=l>j?j:m>(l+o)?m-o:l}};f.list={initialize:function(){this.$input=this.$element.find("input:last");this.previousValue=this.value();f.bind(this,{dataBinding:this.onDataBinding,dataBound:this.onDataBound,error:this.onError,open:this.onOpen,close:this.onClose,valueChange:this.onChange,load:this.onLoad});c(document).bind("mousedown",c.proxy(function(i){var g=this.dropDown.$element;var h=g&&g.parent().length>0;if(h&&!c.contains(this.element,i.target)&&!c.contains(g.parent()[0],i.target)){this.trigger.change();this.trigger.close()}},this))},common:function(){this.open=function(){if(this.data.length==0){return}var g=this.dropDown;if(g.$items){g.open()}else{this.fill(function(){g.open()})}};this.close=function(){this.dropDown.close()};this.dataBind=function(g){this.data=g||[];this.dropDown.dataBind(this.data)};this.highlight=function(k){var j=-1;var g=function(m){var i=m.previousValue;m.close();m.dataBind(m.data);m.previousValue=i;m.dropDown.$items.removeClass("t-state-selected").eq(j).addClass("t-state-selected")};if(!isNaN(k-0)){if(k>-1&&k0){n.filters[l](n,g,k);var h=n.filteredDataIndexes;if((h&&h.length>0)||(l==0&&n.selectedIndex!=-1)){t=false}}if(t){var q={};q[n.queryString.text]=k;n.loader.ajaxRequest(function(v){var w=n.trigger;var u=n.dropDown;if(v&&v.length==0){n.close();n.dataBind();return}n.data=v;f.trigger(n.element,"dataBound");n.filters[l](n,v,k);var x=u.$items;if(x.length>0){if(!u.isOpened()){w.open()}n.filtering.autoFill(n,x.first().text())}else{w.close()}},{data:q})}}else{t=false;n.filters[l](n,n.data,k)}if(!t){var s=m.$items;var i=s.length;var j=n.selectedIndex;var o=l==0?j!=-1?s[j].innerText||s[j].textContent:"":s.length>0?s.first().text():"";this.autoFill(n,o);if(i==0){p.close()}else{if(!m.isOpened()){p.open()}}}};this.multiple=function(g){return g}},filters:function(){this.filters=[function g(h,l,o){if(!l||l.length==0){return}var m=h.dropDown;var k=m.$items;if(k.length==0||h.loader.isAjax()){m.dataBind(l);k=m.$items}for(var j=0,n=l.length;j .t-dropdown-wrap .t-icon").addClass("t-loading")},this),100)},this.hideBusy=function(){clearTimeout(this.busyTimeout);this.component.$element.find("> .t-dropdown-wrap .t-icon").removeClass("t-loading")}},trigger:function(g){this.component=g;this.change=function(){var m=g.data;var o=g.text();var p=o.toLowerCase();var n=g.previousValue;for(var j=0,l=m.length;j0)&&!h.isOpened()&&!f.trigger(g.element,"open")){g.open()}};this.close=function(){if(!g.dropDown.$element.is(":animated")&&g.dropDown.isOpened()&&!f.trigger(g.element,"close")){g.close()}}},highlightFirstOnFilter:function(h,g){if(h.highlightFirst){g.first().addClass("t-state-selected");h.dropDown.scrollTo(g[0])}},moveToEnd:function(g){if(g.createTextRange){var h=g.createTextRange();h.moveStart("textedit",1);h.select()}},selection:function(g,j,h){if(g.createTextRange){var i=g.createTextRange();i.collapse(true);i.moveStart("character",j);i.moveEnd("character",h-j);i.select()}else{if(g.selectionStart){g.selectionStart=j;g.selectionEnd=h}}},updateTextAndValue:function(h,i,g){h.text(i);if(g||g==0){h.$input.val(g)}else{h.$input.val(i)}},getZIndex:function(g){var h="auto";c(g).parents().andSelf().each(function(){h=c(this).css("zIndex");if(Number(h)){h=Number(h)+1;return false}});return h},keycodes:[8,9,13,27,37,38,39,40,35,36,46]};function e(g,h){return function(j,n,o){if(!n||n.length==0){return}var m=c.map(n,function(q,p){if(h(o,q.Text||q)){return p}});var l=m.length;var i=new RegExp("(?![^&;]+;)(?!<[^<>]*)("+o.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)",g?"ig":"i");j.filteredDataIndexes=m;j.selectedIndex=-1;j.dropDown.onItemCreate=function(p){p.html=p.html.replace(i,"$1")};j.dropDown.dataBind(c.map(m,function(q,p){return n[q]}));var k=j.dropDown.$items;k.removeClass("t-state-selected");f.list.highlightFirstOnFilter(j,k)}}function a(g,j,l){if(!g||!j){return null}var m=l.length;l=l.toLowerCase();for(var h=0,k=g.length;h .t-dropdown-wrap > .t-input");this.dropDown=new f.dropDown({outerHeight:i.outerHeight(),outerWidth:i.outerWidth(),zIndex:f.list.getZIndex(i),attr:this.dropDownAttr,effects:this.effects,onOpen:c.proxy(function(){var o=this.dropDown;var n=i.offset();o.position(n.top,n.left);if(!o.outerHeight){o.outerHeight=i.outerHeight()}if(!o.outerWidth){o.outerWidth=i.outerWidth();o.$element.css("width",o.outerWidth-2)}return true},this),onClick:c.proxy(function(n){this.select(n.item);this.trigger.change();this.trigger.close()},this)});this.fill=function(q){function p(r){var s=r.dropDown.$items;var u=r.index;var t=s.filter(".t-state-selected");var v=t.length;var w=u!=-1&&u0?t[v-1]:s[0];r.select(w)}var n=this.dropDown;var o=this.loader;if(!n.$items&&!o.ajaxError){if(o.isAjax()){o.ajaxRequest(function(r){this.data=r;n.dataBind(r);p(this);f.trigger(this.element,"dataBound");this.trigger.change();if(q){q()}})}else{n.dataBind(this.data);p(this);if(q){q()}}}};this.reload=function(){this.dropDown.$items=null;this.fill()};this.select=function(o){var n=this.highlight(o);if(n==-1){return n}this.selectedIndex=n;f.list.updateTextAndValue(this,c(this.dropDown.$items[n]).text(),this.data[n].Value)},this.text=function(n){return this.$text.html(n)};this.value=function(o){if(arguments.length){var o=arguments[0];var n=this.select(function(p){return o==p.Value});if(n!=-1){this.previousValue=o}}else{return this.$input.val()}};f.list.common.call(this);f.list.initialize.call(this);i.bind({keydown:c.proxy(l,this),keypress:c.proxy(m,this),click:c.proxy(function(p){var o=this.trigger;var n=this.dropDown;i.focus();if(n.isOpened()){o.close()}else{if(!n.$items){this.fill(o.open)}else{o.open()}}},this)});function k(){clearTimeout(this.timeout);this.timeout=setTimeout(c.proxy(function(){j=""},this),1000)}function l(t){var q=this.trigger;var o=this.dropDown;var r=t.keyCode||t.which;if(t.altKey&&r==38){q.close();return}if(t.altKey&&r==40){q.open();return}if(r>34&&r<41){t.preventDefault();if(!o.$items){this.fill();return}var p=o.$items;var s=c(p[this.selectedIndex]);var n=(r==35)?p.last():(r==36)?p.first():(r==37||r==38)?s.prev():(r==39||r==40)?s.next():[];if(n.length){var u=n[0];this.select(u);o.scrollTo(u);if(!o.isOpened()){q.change()}}}if(r==8){k();t.preventDefault();j=j.slice(0,-1)}if(r==9||r==13||r==27){q.change();q.close()}}function m(r){var n=this.dropDown;var o=r.keyCode||r.charCode;if(o==0||c.inArray(o,f.list.keycodes)!=-1||r.ctrlKey||r.altKey||r.shiftKey){return}if(!n.$items){this.fill();return}var p=j;p+=String.fromCharCode(o);if(p){var q=a(this.data,n.$items,p);if(q){this.select(q);n.scrollTo(q)}j=p}k()}};c.fn.tDropDownList=function(g){return f.create(this,{name:"tDropDownList",init:function(h,i){return new f.dropDownList(h,i)},options:g})};c.fn.tDropDownList.defaults={effects:f.fx.slide.defaults(),index:0}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.menu.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.menu.min.js new file mode 100644 index 000000000..5ac73a5b1 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.menu.min.js @@ -0,0 +1 @@ +(function(d){var a=d.telerik;a.menu=function(e,f){this.element=e;this.nextItemZIndex=100;d.extend(this,f);d(".t-item:not(.t-state-disabled)",e).live("mouseenter",a.delegate(this,this.mouseenter),true).live("mouseleave",a.delegate(this,this.mouseleave),true).live("click",a.delegate(this,this.click));d(".t-item:not(.t-state-disabled) > .t-link",e).live("mouseenter",a.hover).live("mouseleave",a.leave);d(document).click(a.delegate(this,this.documentClick));a.bind(this,{select:this.onSelect,open:this.onOpen,close:this.onClose,load:this.onLoad})};function b(e){var f=e.parent();return{direction:f.hasClass("t-menu")?f.hasClass("t-menu-vertical")?"right":"bottom":"right"}}function c(f,g){try{return d.contains(f,g)}catch(h){return false}}a.menu.prototype={toggle:function(f,e){d(f).each(function(){d(this).toggleClass("t-state-default",e).toggleClass("t-state-disabled",!e)})},enable:function(e){this.toggle(e,true)},disable:function(e){this.toggle(e,false)},open:function(f){var e=this;d(f).each(function(){var g=d(this);clearTimeout(g.data("timer"));g.data("timer",setTimeout(function(){var h=g.find(".t-group:first");if(h.length){a.fx.play(e.effects,h,b(g));g.css("z-index",e.nextItemZIndex++)}},100))})},close:function(f){var e=this;d(f).each(function(h,i){var g=d(i);clearTimeout(g.data("timer"));g.data("timer",setTimeout(function(){var j=g.find(".t-group:first");if(j.length){a.fx.rewind(e.effects,j,b(g),function(){g.css("zIndex","");if(d(e.element).find(".t-group:visible").length==0){e.nextItemZIndex=100}});j.find(".t-group").stop(false,true)}},100))})},mouseenter:function(i,h){var g=d(h);if(!this.openOnClick||this.clicked){if(!c(h,i.relatedTarget)){this.triggerEvent("open",g);this.open(g);var f=g.parent().closest(".t-item")[0];if(f&&!c(f,i.relatedTarget)){this.mouseenter(i,f)}}}if(this.openOnClick&&this.clicked){this.triggerEvent("close",g);g.siblings().each(d.proxy(function(j,e){this.close(d(e))},this))}},mouseleave:function(i,h){if(!this.openOnClick&&!c(h,i.relatedTarget)){var g=d(h);this.triggerEvent("close",g);this.close(g);var f=g.parent().closest(".t-item")[0];if(f&&!c(f,i.relatedTarget)){this.mouseleave(i,f)}}},click:function(h,g){var f=d(g);a.trigger(this.element,"select",{item:f[0]});if(!f.parent().hasClass("t-menu")||!this.openOnClick){return}h.preventDefault();this.clicked=true;this.triggerEvent("open",f);this.open(f)},documentClick:function(g,f){if(d.contains(this.element,g.target)){return}if(this.clicked){this.clicked=false;d(this.element).children(".t-item").each(d.proxy(function(e,h){this.close(d(h))},this))}},hasChildren:function(e){return e.find(".t-group:first").length},triggerEvent:function(e,f){if(this.hasChildren(f)){a.trigger(this.element,e,{item:f[0]})}}};d.fn.tMenu=function(e){return a.create(this,{name:"tMenu",init:function(f,g){return new a.menu(f,g)},options:e})};d.fn.tMenu.defaults={orientation:"horizontal",effects:a.fx.slide.defaults(),openOnClick:false}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.panelbar.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.panelbar.min.js new file mode 100644 index 000000000..d3c48d751 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.panelbar.min.js @@ -0,0 +1 @@ +(function(c){var a=c.telerik;var b={single:0,multi:1};c.extend(a,{panelbar:function(f,g){this.element=f;var h=c(f);c.extend(this,g);var d=".t-item:not(.t-state-disabled) > .t-link";h.delegate(d,"click",a.delegate(this,this._click)).delegate(d,"mouseenter",a.hover).delegate(d,"mouseleave",a.leave).delegate(".t-item.t-state-disabled > .t-link","click",a.preventDefault);a.bind(this,{expand:this.onExpand,collapse:this.onCollapse,select:c.proxy(function(i){if(i.target==this.element&&this.onSelect){this.onSelect(i)}},this),error:this.onError,load:this.onLoad});var e=h.find("li.t-state-active > .t-content");if(e.length>0&&e.eq(0).children().length==0){this.expand(e.parent())}}});a.panelbar.prototype={expand:function(d){c(d).each(c.proxy(function(f,g){var e=c(g);if(!e.hasClass(".t-state-disabled")&&e.find("> .t-group, > .t-content").length>0){if(this.expandMode==b.single&&this._collapseAllExpanded(e)){return}this._toggleItem(e,false,null)}},this))},collapse:function(d){c(d).each(c.proxy(function(f,g){var e=c(g);if(!e.hasClass(".t-state-disabled")&&e.find("> .t-group, > .t-content").is(":visible")){this._toggleItem(e,true,null)}},this))},toggle:function(e,d){c(e).each(function(){c(this).toggleClass("t-state-default",d).toggleClass("t-state-disabled",!d)})},enable:function(d){this.toggle(d,true)},disable:function(d){this.toggle(d,false)},_click:function(m,d){var f=c(m.target);if(f.closest(".t-link")[0]!=d||f.closest(".t-widget")[0]!=this.element){return}var h=c(d);var j=h.closest(".t-item");h.find(".t-link").removeClass("t-state-selected").end().addClass("t-state-selected");if(a.trigger(this.element,"select",{item:j[0]})){m.preventDefault()}var l=j.find("> .t-content, > .t-group");var i=h.attr("href");var k=(i&&(i.charAt(i.length-1)=="#"||i.indexOf("#"+this.element.id+"-")!=-1));if(k||l.length>0){m.preventDefault()}else{return}if(this.expandMode==b.single){if(this._collapseAllExpanded(j)){return}}if(l.length!=0){var g=l.is(":visible");if(!a.trigger(this.element,!g?"expand":"collapse",{item:j[0]})){this._toggleItem(j,g,m)}}},_toggleItem:function(f,h,i){var j=f.find("> .t-group");if(j.length!=0){this._toggleGroup(j,h);if(i!=null){i.preventDefault()}}else{var g=f.parent().children().index(f);var d=f.find("> .t-content");if(d.length>0){if(i!=null){i.preventDefault()}if(c.trim(d.html()).length>0){this._toggleGroup(d,h)}else{this._ajaxRequest(f,d,h)}}}},_toggleGroup:function(d,e){if(d.data("animating")){return}d.data("animating",true).parent().toggleClass("t-state-default",e).toggleClass("t-state-active",!e).find("> .t-link > .t-icon").toggleClass("t-arrow-up",!e).toggleClass("t-panelbar-collapse",!e).toggleClass("t-arrow-down",e).toggleClass("t-panelbar-expand",e);a.fx[!e?"play":"rewind"](this.effects,d,null,function(){d.data("animating",false)})},_collapseAllExpanded:function(d){if(d.find("> .t-link").hasClass("t-header")){if(d.find("> .t-content, > .t-group").is(":visible")||d.find("> .t-content, > .t-group").length==0){return true}else{c(this.element).children().find("> .t-content, > .t-group").filter(function(){return c(this).is(":visible")}).each(c.proxy(function(f,e){this._toggleGroup(c(e),true)},this))}}},_ajaxRequest:function(e,d,g){var h=e.find(".t-panelbar-collapse, .t-panelbar-expand");var f=setTimeout(function(){h.addClass("t-loading")},100);var i={};c.ajax({type:"GET",cache:false,url:e.find(".t-link").attr("href"),dataType:"html",data:i,error:c.proxy(function(k,j){if(a.ajaxError(this.element,"error",k,j)){return}},this),complete:function(){clearTimeout(f);h.removeClass("t-loading")},success:c.proxy(function(j,l){d.html(j);this._toggleGroup(d,g);var k=d.prev(".t-link");k.data("ContentUrl",k.attr("href")).attr("href","#")},this)})}};c.fn.tPanelBar=function(d){return a.create(this,{name:"tPanelBar",init:function(e,f){return new a.panelbar(e,f)},options:d})};c.fn.tPanelBar.defaults={effects:a.fx.property.defaults("height")}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.tabstrip.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.tabstrip.min.js new file mode 100644 index 000000000..5fa032c86 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.tabstrip.min.js @@ -0,0 +1 @@ +(function(a){var b=a.telerik;a.extend(b,{tabstrip:function(c,d){this.element=c;var e=a(c);a.extend(this,d);var h=".t-tabstrip-items > .t-item:not(.t-state-disabled)";e.delegate(h,"mouseenter",b.hover).delegate(h,"mouseleave",b.leave).delegate(h,d.activateEvent,b.delegate(this,this._click)).delegate("> .t-reset > .t-item.t-state-disabled > .t-link","click",b.preventDefault);b.bind(this,{select:a.proxy(function(i){if(i.target==this.element&&this.onSelect){this.onSelect(i)}},this),error:this.onError,load:this.onLoad});var g=e.find("li.t-state-active");var f=this.getContentElement(e.find("> .t-content"),g.parent().children().index(g));if(f&&f.length>0&&f.children().length==0){this.activateTab(g.eq(0))}}});a.extend(b.tabstrip.prototype,{select:function(c){a(c).each(a.proxy(function(e,f){var d=a(f);if(d.is(".t-state-disabled,.t-state-active")){return}this.activateTab(d)},this))},enable:function(c){a(c).addClass("t-state-default").removeClass("t-state-disabled")},disable:function(c){a(c).removeClass("t-state-default").removeClass("t-state-active").addClass("t-state-disabled")},reload:function(d){var c=this;var e=a("> .t-content",this.element);a(d).each(function(){var g=a(this);var f=g.find(".t-link").data("ContentUrl");if(f){c.ajaxRequest(g,c.getContentElement(e,g.index()),null,f)}})},_click:function(j,f){var h=a(f);var c=h.find(".t-link");var d=c.attr("href");var g=a(this.getContentElement(a("> .t-content",this.element),h.parent().children().index(h)));if(h.is(".t-state-disabled,.t-state-active")){j.preventDefault();return}if(b.trigger(this.element,"select",{item:h[0],contentElement:g[0]})){j.preventDefault()}var i=(d&&(d.charAt(d.length-1)=="#"||d.indexOf("#"+this.element.id+"-")!=-1));if(i||(g.length>0&&g.children().length==0)||g.length==0){j.preventDefault()}else{return}if(this.activateTab(h)){j.preventDefault()}},activateTab:function(d){var f=d.parent().children().removeClass("t-state-active").addClass("t-state-default").index(d);d.removeClass("t-state-default").addClass("t-state-active");var h=d.parent().parent().find("> .t-content");if(h.length>0){var e=h.filter(".t-state-active");var j=this.getContentElement(h,f);var g=this;if(!j){e.removeClass("t-state-active");b.fx.rewind(g.effects,e,{});return false}var c=a.trim(j.html()).length==0;var i=function(){j.addClass("t-state-active");b.fx.play(g.effects,j,{})};e.removeClass("t-state-active").stop(false,true);b.fx.rewind(g.effects,e,{},function(){if(d.hasClass("t-state-active")){if(!c){i()}else{if(c){g.ajaxRequest(d,j,function(){if(d.hasClass("t-state-active")){i()}})}}}});return true}return false},getContentElement:function(g,f){var d=new RegExp("-"+(f+1)+"$");for(var c=0,e=g.length;c').prependTo(d.find(".t-link"))},100);var f={};a.ajax({type:"GET",cache:false,url:e||d.find(".t-link").attr("href"),dataType:"html",data:f,error:a.proxy(function(l,k){if(b.ajaxError(this.element,"error",l,k)){return}},this),complete:function(){clearTimeout(g);if(h!==null){h.remove()}},success:a.proxy(function(k,n){c.html(k);var l=d.find(".t-link");var m=l.attr("href");if(m&&m!="#"){l.data("ContentUrl",m).attr("href","#")}if(j){j.call(i,c)}},this)})}});a.fn.tTabStrip=function(c){return b.create(this,{name:"tTabStrip",init:function(d,e){return new b.tabstrip(d,e)},options:c})};a.fn.tTabStrip.defaults={activateEvent:"click",effects:b.fx.toggle.defaults()}})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.textbox.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.textbox.min.js new file mode 100644 index 000000000..269e507a0 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.textbox.min.js @@ -0,0 +1 @@ +(function(d){var g=d.telerik;var e={"190":".","110":".","188":","};var a=[8,9,37,38,39,40,46,35,36,44];g.textbox=function(h,i){this.element=h;d.extend(this,i);var o=new g.stringBuilder();o.cat("[ |").cat(this.groupSeparator).catIf("|"+this.symbol,this.symbol).cat("]");this.replaceRegExp=new RegExp(o.string(),"g");var n=d.browser.msie?"paste":"input";var k=d(".t-input",h);var l=k.attr("value");d("",{id:k.attr("id")+"-text",name:k.attr("name")+"-text","class":k.attr("class"),value:(l||this.text),style:k.attr("style")}).bind({blur:g.delegate(this,this.blur),focus:g.delegate(this,this.focus),keydown:g.delegate(this,this.keydown),keypress:g.delegate(this,this.keypress),change:function(p){p.stopPropagation();return false}}).bind(n,g.delegate(this,this[n])).insertBefore(k);k.hide().appendTo(h);var j=d(".t-arrow-up, .t-arrow-down",h).bind({mouseup:g.delegate(this,this.clearTimer),mouseout:g.delegate(this,this.clearTimer),click:g.preventDefault,dragstart:g.preventDefault,dblclick:g.delegate(this,this.clearTimer)});d(j[0]).mousedown(d.proxy(function(p){this.updateState();this.stepper(p,1)},this));d(j[1]).mousedown(d.proxy(function(p){this.updateState();this.stepper(p,-1)},this));this.numFormat=this.numFormat===undefined?this.type.charAt(0):this.numFormat;var m=this.separator;this.step=this.parse(this.step,m);this.val=this.parse(this.val,m);this.minValue=this.parse(this.minValue,m);this.maxValue=this.parse(this.maxValue,m);if(l!=""){this.value(l)}g.bind(this,{change:this.onChange,load:this.onLoad})};g.textbox.prototype={enable:function(){d(".t-input:first",this.element).first().attr("disabled",false);var h=d(".t-icon",this.element);d(h[0]).mousedown(d.proxy(function(i){this.updateState();this.stepper(i,1)},this));d(h[1]).mousedown(d.proxy(function(i){this.updateState();this.stepper(i,-1)},this))},disable:function(){d(".t-input:first",this.element).first().attr("disabled",true);d(".t-icon",this.element).unbind("mousedown")},updateState:function(){var h=d("> .t-input:first",this.element).val();if(this.val!=h.replace(this.replaceRegExp,"")){this.parseTrigger(h)}},input:function(k,i){var h=d(i).val();if(h=="-"){return true}var j=this.parse(h,this.separator);if(j||j==0){this.trigger(this.round(j,this.digits))}},paste:function(m,h){var j=d(h);var i=j.val();var k=h.document.selection.createRange().text;var n=window.clipboardData.getData("Text");if(k>0){i=i.replace(k,n)}else{i+=n}var l=this.parse(i,this.separator);if(l||l==0){this.trigger(this.round(l,this.digits))}},focus:function(j,i){this.focused=true;this.updateState();var h=this.formatEdit(this.val);d(i).val(h||(h==0?0:""));if(!d.browser.safari){i.select()}},blur:function(i){var j=d(i.target);this.focused=false;var h=j.val();if(!h&&h!="0"||!this.val&&this.val!=0){this.value(null);j.removeClass("t-state-error").val(this.text||"");return true}else{if(this.inRange(this.val,this.minValue,this.maxValue)){j.removeClass("t-state-error").val(this.format(this.val))}else{j.addClass("t-state-error")}}},keydown:function(m,h){var j=m.keyCode;var k=d(h);var l=this.separator;var i=e[j];if(i){if(i==l&&this.digits>0&&g.caretPos(k[0])!=0&&k.val().indexOf(l)==-1){return true}else{m.preventDefault()}}if(j==8||j==46){setTimeout(g.delegate(this,function(){this.parseTrigger(k.val())}));return true}if(j==38||j==40){this.modifyInput(k,this.step*(j==38?1:-1));return true}if(j==222){m.preventDefault()}},keypress:function(i){var j=d(i.target);var h=i.keyCode||i.which;if(h==0||d.inArray(h,a)!=-1||i.ctrlKey||(i.shiftKey&&h==45)){return true}if(((this.minValue!==null?this.minValue<0:true)&&String.fromCharCode(h)=="-"&&g.caretPos(j[0])==0&&j.val().indexOf("-")==-1)||this.inRange(h,48,57)){setTimeout(g.delegate(this,function(){this.parseTrigger(j.val())}));return true}i.preventDefault()},clearTimer:function(h){clearTimeout(this.timeout);clearInterval(this.timer);clearInterval(this.acceleration)},stepper:function(k,h){if(k.which==1){var i=d(".t-input:first",this.element);var j=this.step;this.modifyInput(i,h*j);this.timeout=setTimeout(g.delegate(this,function(){this.timer=setInterval(g.delegate(this,function(){this.modifyInput(i,h*j)}),80);this.acceleration=setInterval(function(){j+=1},1000)}),200)}},value:function(h){if(arguments.length==0){return this.val}var j=(typeof h===typeof 1)?h:this.parse(h,this.separator);var i=j===null;this.val=j;d(".t-input:last",this.element).val(i?"":this.formatEdit(j));d(".t-input:first",this.element).toggleClass("t-state-error",!this.inRange(this.val,this.minValue,this.maxValue)).val(i?this.text:this.format(j));return this},modifyInput:function(i,h){var k=this.val;var l=this.minValue;var n=this.maxValue;k=k?k+h:h;k=(l!==null&&kn)?n:k;var j=this.round(k,this.digits);this.trigger(j);var m=this.focused?this.formatEdit(j):this.format(j);i.removeClass("t-state-error").val(m)},formatEdit:function(i){var h=this.separator;if(i&&h!="."){i=i.toString().replace(".",h)}return i},format:function(h){return g.textbox.formatNumber(h,this.numFormat,this.digits,this.separator,this.groupSeparator,this.groupSize,this.positive,this.negative,this.symbol,true)},trigger:function(h){if(this.val!=h){if(g.trigger(this.element,"change",{oldValue:this.val,newValue:h})){return}d(".t-input:last",this.element).val(this.formatEdit(h));this.val=h}},parseTrigger:function(h){this.trigger(this.round(this.parse(h,this.separator),this.digits))},inRange:function(j,h,i){return(h!==null?j>=h:true)&&(i!==null?j<=i:true)},parse:function(h,j){var i=null;if(h||h=="0"){if(typeof h==typeof 1){return h}h=h.replace(this.replaceRegExp,"");if(j&&j!="."){h=h.replace(j,".")}i=parseFloat(h)}return isNaN(i)?null:i},round:function(i,h){if(i||i==0){return parseFloat(i.toFixed(h||2))}return null}};d.fn.tTextBox=function(j){var i=j.type;var h=d.fn.tTextBox.defaults[i];h.digits=g.cultureInfo[i+"decimaldigits"];h.separator=g.cultureInfo[i+"decimalseparator"];h.groupSeparator=g.cultureInfo[i+"groupseparator"];h.groupSize=g.cultureInfo[i+"groupsize"];h.positive=g.cultureInfo[i+"positive"];h.negative=g.cultureInfo[i+"negative"];h.symbol=g.cultureInfo[i+"symbol"];j=d.extend({},h,j);return this.each(function(){var k=d(this);j=d.meta?d.extend({},j,k.data()):j;if(!k.data("tTextBox")){k.data("tTextBox",new g.textbox(this,j));g.trigger(this,"load")}})};d.fn.tTextBox.defaults={numeric:{val:null,minValue:-100,maxValue:100,text:"",step:1},currency:{val:null,minValue:0,maxValue:1000,text:"",step:1},percent:{val:null,minValue:0,maxValue:100,text:"",step:1}};d.fn.tTextBox.patterns={numeric:{negative:["(n)","-n","- n","n-","n -"]},currency:{positive:["*n","n*","* n","n *"],negative:["(*n)","-*n","*-n","*n-","(n*)","-n*","n-*","n*-","-n *","-* n","n *-","* n-","* -n","n- *","(* n)","(n *)"]},percent:{positive:["n *","n*","*n"],negative:["-n *","-n*","-*n"]}};if(!g.cultureInfo.numericnegative){d.extend(g.cultureInfo,{currencydecimaldigits:2,currencydecimalseparator:".",currencygroupseparator:",",currencygroupsize:3,currencynegative:0,currencypositive:0,currencysymbol:"$",numericdecimaldigits:2,numericdecimalseparator:".",numericgroupseparator:",",numericgroupsize:3,numericnegative:1,percentdecimaldigits:2,percentdecimalseparator:".",percentgroupseparator:",",percentgroupsize:3,percentnegative:0,percentpositive:0,percentsymbol:"%"})}var c=/[0#?]/;function b(h){return h.split("").reverse().join("")}function f(n,h,k){var p=0,q=0;var s=h.length;var m=n.length;var u=new g.stringBuilder();while(p=0){if(h.charAt(p).match(c)){u.cat(n.charAt(q));q++}else{u.cat(h.charAt(p))}p++}u.catIf(n.substring(q),q1?n[1].replace("}",""):n[0];var l=n.search(c)!=-1;if(l){n=n.split(";");G=n[0];L=n[1];m=n[2];n=(J&&L?L:G).indexOf("%")!=-1?"p":"n"}switch(n){case"d":case"D":return Math.round(K).toString();case"c":case"C":P="currency";break;case"n":case"N":P="numeric";break;case"p":case"P":P="percent";if(!F){K=Math.abs(K)*100}break;default:return K.toString()}var z=function(T,R,S){for(var U=T.length;U1?C[1]:"";var h=g.lastIndexOf(A,"0");var x=g.lastIndexOf(A,"#");var s=(x>h?x:h)+1}var B=Math.pow(10,s);var N=(Math.round(K*B)/B);K=isFinite(N)?N:K;var v=K.toString().split(/e/i);y=v.length>1?parseInt(v[1]):0;v=v[0].split(".");j=v[0];j=J?j.replace("-",""):j;r=v.length>1?v[1]:"";if(y){if(!J){r=z(r,y,false);j+=r.slice(0,y);r=r.substr(y)}else{j=z(j,y+1,true);r=j.slice(y,j.length)+r;j=j.slice(0,y)}}var O=r.length;if(s<1||(l&&h==-1&&O===0)){r=""}else{r=O>s?r.slice(0,s):z(r,s,false)}var k;if(l){j=f(b(j),b(w),true);j=w.indexOf(",")!=-1?I(j,i,Q):j;r=r&&A?f(r,A):"";k=K===0&&m?m:(J&&!L?"-":"")+j+(r.length>0?u+r:"")}else{j=I(j,i,Q);H=H[P];var t=J?H.negative[q]:M?H.positive[o]:null;var p=j+(r.length>0?u+r:"");k=t?t.replace("n",p).replace("*",M):p}return k};d.extend(g.formatters,{number:g.textbox.formatNumber})})(jQuery); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/2010.2.825/telerik.treeview.min.js b/NzbDrone.Web/Scripts/2010.2.825/telerik.treeview.min.js new file mode 100644 index 000000000..cb87ddf55 --- /dev/null +++ b/NzbDrone.Web/Scripts/2010.2.825/telerik.treeview.min.js @@ -0,0 +1 @@ +(function(a){var b=a.telerik;b.treeview=function(e,f){this.element=e;var g=a(e);a.extend(this,f);var c=".t-in:not(.t-state-selected,.t-state-disabled)";a(".t-in.t-state-selected",e).live("mouseenter",b.preventDefault);g.delegate(c,"mouseenter",b.hover).delegate(c,"mouseleave",b.leave).delegate(c,"click",b.delegate(this,this.nodeSelect)).delegate("div:not(.t-state-disabled) .t-in","dblclick",b.delegate(this,this.nodeClick)).delegate(":checkbox","click",b.delegate(this,this.checkboxClick)).delegate(".t-plus, .t-minus","click",b.delegate(this,this.nodeClick));if(this.isAjax()){g.find(".t-plus").each(function(){var h=a(this.parentNode);h.parent().data("loaded",h.next(".t-group").length>0)})}if(this.dragAndDrop){b.bind(this,{nodeDragStart:this.onNodeDragStart,nodeDragging:this.onNodeDragging,nodeDragCancelled:this.onNodeDragCancelled,nodeDrop:this.onNodeDrop,nodeDropped:this.onNodeDropped});b.draganddrop(this.element.id,a.extend({useDragClue:true,draggables:a("div:not(.t-state-disabled) .t-in",e)},b.draganddrop.applyContext(b.draganddrop.treeview,this)))}var d=g.find(".t-item > .t-content");if(d.length>0&&a(d[0]).children().length==0){g.find(".t-icon").hide()}b.bind(this,{expand:this.onExpand,collapse:this.onCollapse,select:a.proxy(function(h){if(h.target==this.element&&this.onSelect){this.onSelect(h)}},this),checked:this.onChecked,error:this.onError,load:this.onLoad,dataBinding:this.onDataBinding,dataBound:this.onDataBound})};b.treeview.prototype={expand:function(c){a(c,this.element).each(a.proxy(function(f,g){var e=a(g);var d=e.find("> .t-group, > .t-content");if((d.length>0&&!d.is(":visible"))||this.isAjax()){this.nodeToggle(null,e)}},this))},collapse:function(c){a(c,this.element).each(a.proxy(function(f,g){var e=a(g);var d=e.find("> .t-group, > .t-content");if(d.length>0&&d.is(":visible")){this.nodeToggle(null,e)}},this))},enable:function(c){this.toggle(c,true)},disable:function(c){this.toggle(c,false)},toggle:function(d,c){a(d,this.element).each(a.proxy(function(f,g){var e=a(g);this.collapse(e);e.find("> div > .t-icon").toggleClass("t-state-default",c).toggleClass("t-state-disabled",!c);e.find("> div > .t-in").toggleClass("t-state-default",c).toggleClass("t-state-disabled",!c)},this))},reload:function(d){var c=this;a(d).each(function(){var e=a(this);e.find(".t-group").remove();c.ajaxRequest(e)})},shouldNavigate:function(d){var c=a(d).closest(".t-item").find("> .t-content, > .t-group");var e=a(d).attr("href");return !((e&&(e.charAt(e.length-1)=="#"||e.indexOf("#"+this.element.id+"-")!=-1))||(c.length>0&&c.children().length==0))},nodeSelect:function(f,d){if(!this.shouldNavigate(d)){f.preventDefault()}var c=a(d);if(!c.hasClass(".t-state-selected")&&!b.trigger(this.element,"select",{item:c.closest(".t-item")[0]})){a(".t-in",this.element).removeClass("t-state-hover t-state-selected");c.addClass("t-state-selected")}},nodeToggle:function(h,d,g){if(h!=null){h.preventDefault()}if(d.data("animating")||!d.find("> div > .t-icon").is(":visible")||d.find("> div > .t-in").hasClass("t-state-disabled")){return}d.data("animating",!g);var c=d.find("> .t-group, > .t-content");var f=!c.is(":visible");if(c.children().length>0&&d.data("loaded")!==false&&!b.trigger(this.element,f?"expand":"collapse",{item:d[0]})){d.find("> div > .t-icon").toggleClass("t-minus",f).toggleClass("t-plus",!f);if(!g){b.fx[f?"play":"rewind"](this.effects,c,{direction:"bottom"},function(){d.data("animating",false)})}else{c[f?"show":"hide"]()}}else{if(f&&this.isAjax()&&(c.length==0||d.data("loaded")===false)){this.ajaxRequest(d)}}},nodeClick:function(g,f){var d=a(f);var c=d.closest(".t-item");if(d.hasClass("t-plus-disabled")||d.hasClass("t-minus-disabled")){return}this.nodeToggle(g,c)},isAjax:function(){return this.ajax||this.ws||this.onDataBinding},url:function(c){return(this.ajax||this.ws)[c]},ajaxOptions:function(c,f){var d={type:"POST",dataType:"text",error:a.proxy(function(h,g){if(b.ajaxError(this.element,"error",h,g)){return}if(g=="parsererror"){alert("Error! The requested URL did not return JSON.")}},this),success:a.proxy(function(g){g=eval("("+g+")");g=g.d||g;this.dataBind(c,g)},this)};d=a.extend(d,f);var e=this.ws?d.data.node={}:d.data;if(c.hasClass("t-item")){e[this.queryString.value]=this.getItemValue(c);e[this.queryString.text]=this.getItemText(c)}if(this.ws){d.data=b.toJson(d.data);d.contentType="application/json; charset=utf-8"}return d},ajaxRequest:function(c){c=c||a(this.element);if(b.trigger(this.element,"dataBinding",{item:c[0]})||(!this.ajax&&!this.ws)){return}c.data("loadingIconTimeout",setTimeout(function(){c.find("> div > .t-icon").addClass("t-loading")},100));a.ajax(this.ajaxOptions(c,{data:{},url:this.url("selectUrl")}))},bindTo:function(c){var d=a(this.element);this.dataBind(d,c)},dataBind:function(c,g){c=a(c);if(g.length==0){a(".t-icon",c).hide();return}var d=c.find("> .t-group");var e=d.length==0;var f=new b.stringBuilder();b.treeview.getGroupHtml(g,f,this.isAjax(),c.hasClass("t-treeview"),this.showCheckBox,e?g[0].Expanded:false,e);c.data("animating",true);if(d.length>0&&c.data("loaded")===false){a(f.string()).prependTo(d)}else{if(d.length>0&&c.data("loaded")!==false){d.html(f.string())}else{if(d.length==0){d=a(f.string()).appendTo(c)}}}b.fx.play(this.effects,d,{direction:"bottom"},function(){c.data("animating",false)});clearTimeout(c.data("loadingIconTimeout"));if(c.hasClass("t-item")){c.data("loaded",true).find(".t-icon:first").removeClass("t-loading").removeClass("t-plus").addClass("t-minus")}b.trigger(this.element,"dataBound")},checkboxClick:function(g,d){var c=a(d).is(":checked");var f=b.trigger(this.element,"checked",{item:a(d).closest(".t-item")[0],checked:c});if(!f){this.nodeCheck(d,c)}else{g.preventDefault()}return f},nodeCheck:function(d,c){a(d,this.element).each(a.proxy(function(l,m){var h=a(m);var f=h.closest(".t-item");var k=a("> div > .t-checkbox",f);var j=this.element.id+"_checkedNodes";var g=k.find(':input[name="'+j+'.Index"]');var e=g.val();k.find(':input[name="'+j+"["+e+'].Text"]').remove();k.find(':input[name="'+j+"["+e+'].Value"]').remove();k.find(":checkbox").attr("checked",c?"checked":"");if(c){var i=new b.stringBuilder();i.cat('').cat('');a(i.string()).appendTo(k)}},this))},getItemText:function(c){return a(c).find("> div > .t-in").text()},getItemValue:function(c){return a(c).find('>div>:input[name="itemValue"]').val()||this.getItemText(c)}};a.extend(b.draganddrop,{treeview:{shouldDrag:function(c){return true},createDragClue:function(c){return c.closest(".t-top,.t-mid,.t-bot").text()},onDragStart:function(d,f){var c=b.trigger(this.element,"nodeDragStart",{item:f.closest(".t-item")[0]});if(!c){this.$dropClue=a('
').appendTo(this.element)}return c},onDragMove:function(n,i){var o;b.trigger(this.element,"nodeDragging",{pageY:n.pageY,dropTarget:n.target,setStatusClass:function(e){o=e},item:i.closest(".t-item")[0]});if(o){this.$dropClue.css("visibility","hidden");return o}if(this.dragAndDrop.dropTargets&&a(n.target).closest(this.dragAndDrop.dropTargets).length>0){return"t-add"}if(!a.contains(this.element,n.target)){this.$dropClue.css("visibility","hidden");return}else{if(a.contains(i.closest(".t-item")[0],n.target)){this.$dropClue.css("visibility","hidden");return"t-denied"}}this.$dropClue.css("visibility","visible");var m="t-insert-middle";var c=a(n.target);var q=c.closest(".t-top,.t-mid,.t-bot");if(q.length>0){var f=q.outerHeight();var l=q.offset().top;var d=c.closest(".t-in");var h=f/(d.length>0?4:2);var p=n.pageY<(l+h);var k=(l+f-h)0&&!p&&!k;d.toggleClass("t-state-hover",g);this.$dropClue.css("visibility",g?"hidden":"visible");if(g){m="t-add";this.$dropTarget=c}else{var j=q.position();j.top+=p?0:f;this.$dropClue.css(j)[p?"prependTo":"appendTo"](c.closest(".t-item").find("> div:first"));m="t-insert-middle";if(p&&q.hasClass("t-top")){m="t-insert-top"}if(k&&q.hasClass("t-bot")){m="t-insert-bottom"}}}return m},onDragCancelled:function(c,d){b.trigger(this.element,"nodeDragCancelled",{item:d.closest(".t-item")[0]});this.$dropClue.remove()},onDrop:function(f,g,c){var d=b.trigger(this.element,"nodeDrop",{isValid:!c.find(".t-drag-status").hasClass("t-denied"),dropTarget:f.target,item:g.closest(".t-item")[0]});if(d||!a.contains(this.element,f.target)){this.$dropClue.remove();return d}return d?true:a.proxy(function(e){var l=g.closest(".t-top,.t-mid,.t-bot");var n=l.parent();var p=l.closest(".t-group");if(a.contains(n[0],f.target)){e();this.$dropClue.remove();return}if(n.hasClass("t-last")){n.removeClass("t-last").prev().addClass("t-last").find("> div").removeClass("t-top t-mid").addClass("t-bot")}var j="over";var i;if(this.$dropClue.css("visibility")=="visible"){var m=this.$dropClue.closest(".t-item");j=this.$dropClue.prevAll(".t-in").length>0?"after":"before";i=m.find("> div");m[j](n)}else{i=this.$dropTarget.closest(".t-top,.t-mid,.t-bot");var h=i.next(".t-group");if(h.length===0){h=a('
    ').appendTo(i.parent());i.prepend('')}h.append(n);if(i.find("> .t-icon").hasClass("t-plus")){this.nodeToggle(null,i.parent(),true)}}b.trigger(this.element,"nodeDropped",{destinationItem:i.closest(".t-item")[0],dropPosition:j,item:l.parent(".t-item")[0]});var k=n.parents(".t-group").length;var o=function(r){var s=r.prev().length===0;var q=r.next().length===0;r.toggleClass("t-first",s&&k===1).toggleClass("t-last",q).find("> div").toggleClass("t-top",s&&!q).toggleClass("t-mid",!s&&!q).toggleClass("t-bot",q)};o(n);o(n.prev());o(n.next());if(p.children().length===0){p.prev("div").find(".t-plus,.t-minus").remove();p.remove()}e();this.$dropClue.remove()},this)}}});a.extend(b.treeview,{getItemHtml:function(i,f,g,d,h,e,c){f.cat('
  • ').cat('
    ');if((g&&i.LoadOnDemand)||(i.Items&&i.Items.length>0)){f.cat('')}if(h&&i.Checkable!==false){f.cat('")}f.cat(i.NavigateUrl?'');if(i.ImageUrl!=null){f.cat('')}f.catIf(i.Text,i.Encoded===false).catIf(i.Text.replace(//g,">"),i.Encoded!==false).cat(i.NavigateUrl?"":"");if(i.Value){f.cat('')}f.cat("
    ");if(i.Items&&i.Items.length>0){b.treeview.getGroupHtml(i.Items,f,g,false,h,i.Expanded)}f.cat("
  • ")},getGroupHtml:function(c,f,h,d,j,l,k){if(k!==false){f.cat('